2016-11-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gnat.dg / aliased1.adb
blob774ffe5f785c8cea2a08effb7bf65ebb879514f3
1 -- { dg-do compile }
2 -- { dg-options "-gnatws" }
4 procedure aliased1 is
6 type E is (One, Two);
8 type R (D : E := One) is record
9 case D is
10 when One =>
11 I1 : Integer;
12 I2 : Integer;
13 when Two =>
14 B1 : Boolean;
15 end case;
16 end record;
18 type Data_Type is record
19 Data : R;
20 end record;
22 type Array_Type is array (Natural range <>) of Data_Type;
24 function Get return Array_Type is
25 Ret : Array_Type (1 .. 2);
26 begin
27 return Ret;
28 end;
30 Object : aliased Array_Type := Get;
32 begin
33 null;
34 end;