analyzer: Fix PR analyzer/101980
[official-gcc.git] / gcc / testsuite / gnat.dg / pack24.adb
blob90d6134c7ab8e3dd7ebc343508c580e63b05c718
1 -- { dg-do run }
3 with Interfaces;
5 procedure Pack24 is
7 type Enum_1 is (Lit_1);
8 for Enum_1'SIZE use 16;
10 type Rec1(D1 : Enum_1 := Lit_1) is
11 record
12 case D1 is
13 when Lit_1 =>
14 F1 : Interfaces.Unsigned_16;
15 when others =>
16 Null;
17 end case;
18 end record;
19 pragma Pack(Rec1);
21 type Rec2 is
22 record
23 F1 : Interfaces.Unsigned_16;
24 F2 : Rec1;
25 end record;
26 pragma Pack(Rec2);
28 type Rec3 is record
29 F1 : Interfaces.Unsigned_8;
30 F2 : Rec2;
31 end record;
32 pragma Pack(Rec3);
34 begin
35 if Rec3'Size /= 56 then
36 raise Program_Error;
37 end if;
38 end;