gcc/cp
[official-gcc.git] / gcc / testsuite / gnat.dg / unchecked_convert4.adb
blob8f3a1aa4efee4fc259798739b4ecf013aaf26d7b
1 -- { dg-do compile }
3 with Unchecked_Conversion;
5 procedure Unchecked_Convert4 is
7 type Uint32 is mod 2**32;
9 type Rec is record
10 I : Uint32;
11 end record;
12 for Rec'Size use 32;
13 pragma Atomic (Rec);
15 function Conv is new Unchecked_Conversion (Uint32, Rec);
17 function F return Uint32;
18 pragma Import (Ada, F);
20 procedure Proc (R : Rec) is begin null; end;
22 begin
23 Proc (Conv (F or 1));
24 end;