aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/static_pred1.adb
blob: 16bbde2c65be3ba937b51083f6821b658b35ffab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--  { dg-do compile }

package body Static_Pred1 is

   type Enum_Type is (A, B, C);

   subtype Enum_Subrange is Enum_Type with Static_Predicate =>
     Enum_Subrange in A | C;

   function "not" (Kind : Enum_Subrange) return Enum_Subrange is
     (case Kind is
      when A => C,
      when C => A);

   procedure Dummy (Value : T) is
      IK : Enum_Subrange := not A;
   begin
      null;
   end Dummy;

end Static_Pred1;