2017-07-25 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gnat.dg / unchecked_union1.adb
blob671d0b0c7554bcdc24618f7775678432e2d6e119
1 -- { dg-do run }
3 procedure Unchecked_Union1 is
5 type Bit is (Zero, One);
7 type U (X : Bit := Zero) is record
8 case X is
9 when Zero => I: Integer;
10 when One => F : Float;
11 end case;
12 end record;
13 for U use record
14 I at 0 range 0 .. 31;
15 F at 0 range 0 .. 31;
16 end record;
17 pragma Unchecked_Union(U);
19 begin
20 if U'Object_Size /= 32 then
21 raise Program_Error;
22 end if;
23 end;