OSDN Git Service

2008-04-24 Olivier Hainque <hainque@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gnat.dg / aliased1.adb
1 --  { dg-do compile }
2 --  { dg-options "-gnatws" }
3
4 procedure aliased1 is
5   
6   type E is (One, Two);
7   
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;
17   
18   type Data_Type is record
19     Data : R;
20   end record;
21   
22   type Array_Type is array (Natural range <>) of Data_Type;
23   
24   function Get return Array_Type is
25     Ret : Array_Type (1 .. 2);
26   begin
27     return Ret;
28   end;
29   
30   Object : aliased Array_Type := Get;
31
32 begin
33   null;
34 end;