gcc/cp
[official-gcc.git] / gcc / testsuite / gnat.dg / alignment9.adb
blobae7a7f67e9e8bb44f2430ce992d3729406b8813e
1 -- { dg-do run }
2 -- { dg-options "-gnatws" }
4 procedure Alignment9 is
6 type Kind is (Small, Large);
7 for Kind'Size use 8;
9 type Header is
10 record
11 K : Kind;
12 I : Integer;
13 end record;
15 for Header use
16 record
17 K at 4 range 0..7;
18 I at 0 range 0..31;
19 end record;
21 for Header'Size use 5*8;
22 for Header'Alignment use 1;
24 H : Header;
26 begin
27 if H'Size /= 40 then
28 raise Program_Error;
29 end if;
30 end;