P0329R4: Designated Initialization
[official-gcc.git] / gcc / testsuite / gnat.dg / pack10.adb
blob945e404d2ec7728e1937d46132e2d070edaa1853
1 -- { dg-do run }
3 procedure Pack10 is
5 type U16 is mod 2**16;
6 type U8 is mod 2**8;
8 type R is record
9 A : U16;
10 B : U8;
11 end record;
13 type M is array (1..2) of R;
14 pragma Pack (M);
15 -- This size clause can actually be omitted
16 for M'Size use 48;
18 type R2 is record
19 C : M;
20 D : U8;
21 end record;
22 for R2 use record
23 C at 0 range 0 .. 24*2-1;
24 end record;
26 My_R2 : R2;
28 begin
29 My_R2.D := 1;
30 My_R2.C(2).B := 0;
31 if My_R2.D /=1 then
32 raise Program_Error;
33 end if;
34 end;