summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/aliased1.adb
blob: 774ffe5f785c8cea2a08effb7bf65ebb879514f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--  { dg-do compile }
--  { dg-options "-gnatws" }

procedure aliased1 is
  
  type E is (One, Two);
  
  type R (D : E := One) is record
    case D is
      when One =>
         I1 : Integer;
         I2 : Integer;
      when Two =>
         B1 : Boolean;
    end case;
  end record;
  
  type Data_Type is record
    Data : R;
  end record;
  
  type Array_Type is array (Natural range <>) of Data_Type;
  
  function Get return Array_Type is
    Ret : Array_Type (1 .. 2);
  begin
    return Ret;
  end;
  
  Object : aliased Array_Type := Get;

begin
  null;
end;