Preserving locations for variable-uses and constants (PR c++/43486)
[official-gcc.git] / gcc / testsuite / gnat.dg / volatile4.adb
blobfe2b30760ce606941a29f86d7381c98b073a57f8
1 -- { dg-do run }
3 procedure Volatile4 is
5 type My_Int is new Integer;
6 pragma Volatile (My_Int);
8 type Rec is record
9 I : My_Int;
10 end record;
12 function F (R : Rec) return Rec is
13 begin
14 return R;
15 end;
17 R : Rec := (I => 0);
19 begin
20 R := F (R);
21 if R.I /= 0 then
22 raise Program_Error;
23 end if;
24 end;