PR testsuite/86649
[official-gcc.git] / gcc / testsuite / gnat.dg / pack22_pkg.ads
blob74053b38eb6b3fa82be553edcf11adaf4c158485
1 package Pack22_Pkg is
3 type byte is mod 256;
4 Temp_buffer : array (0..8) of byte:= (others => 0);
5 for Temp_buffer'Alignment use 2;
7 subtype Id is Short_integer;
9 generic
10 Dummy : Integer := 0;
11 package Bit_Map_Generic is
13 type List is private;
14 function "xor" (L, R : List) return List;
16 private
17 type Offset_T is range 0 .. Id'Last;
18 type Counter_T is new short_integer;
19 for Counter_T'Size use 16;
21 type Bit_List is array (Id range <>) of Boolean;
22 pragma Pack (Bit_List);
24 type List_Counter_T (Is_Defined : Boolean := True) is
25 record
26 Dummy : Boolean := False;
27 case Is_Defined is
28 when True =>
29 Counter : Counter_T := 0;
30 when False =>
31 null;
32 end case;
33 end record;
34 for List_Counter_T use
35 record
36 Is_Defined at 0 range 0 .. 7;
37 Dummy at 1 range 0 .. 7;
38 Counter at 2 range 0 .. 15;
39 end record;
41 type List is
42 record
43 Offset : Offset_T := Offset_T (1) - 1;
44 Counter : List_Counter_T;
45 Bits : Bit_List (1 .. 6);
46 end record;
47 for List use
48 record
49 Offset at 0 range 0 .. 15;
50 Counter at 2 range 0 .. 31;
51 end record;
53 type Iterator is
54 record
55 No_More_Id : Boolean := True;
56 Current_Id : Id;
57 The_List : List;
58 end record;
60 end Bit_Map_Generic;
62 end Pack22_Pkg;