PR target/84336
[official-gcc.git] / gcc / testsuite / gnat.dg / self_aggregate_with_call.adb
blob4979bd4fc0220119a8e53e85caaa22e63018857d
1 -- { dg-do run }
2 -- { dg-options "-O2" }
4 procedure self_aggregate_with_call is
6 type Values is array (1 .. 8) of Natural;
8 type Vector is record
9 Components : Values;
10 end record;
12 function Clone (Components: Values) return Values is
13 begin
14 return Components;
15 end;
17 procedure Process (V : in out Vector) is
18 begin
19 V.Components (Values'First) := 1;
20 V := (Components => Clone (V.Components));
22 if V.Components (Values'First) /= 1 then
23 raise Program_Error;
24 end if;
25 end;
27 V : Vector;
28 begin
29 Process (V);
30 end;