summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/discr59_pkg1.ads
blob: 455250b33e97c581ab0eceb33bfdaa84fe54099b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
with Discr59_Pkg2;

package Discr59_Pkg1 is

   subtype Index_Type is Natural range 1 .. 300;

   type Code_Type is (Global_Query, Status_Query, Alert);

   type Id_Type is (None, At_Command, At_Response);

   package My_G is new Discr59_Pkg2 (21);

   type Arr is array (Index_Type range <>) of My_G.Token_Type;

   type Unit_List_Type (Last : Natural) is record
      A : Arr (1 .. Last);
   end record;

   type At_Response_Type (Kind : Code_Type; Units : Natural) is record
      case Kind is
         when Global_Query => Global_Query : Unit_List_Type (Units);
         when Status_Query => null;
         when Alert        => Alert : Unit_List_Type (Units);
      end case;
   end record;

   type Rec (Kind : Id_Type; Code : Code_Type; Units : Natural) is record
      case Kind is
         when None        => null;
         when At_Command  => null;
         when At_Response => At_Response : At_Response_Type (Code, Units);
      end case;
   end record;

end Discr59_Pkg1;