Imported Upstream version 4.7.3
[platform/upstream/gcc48.git] / gcc / testsuite / gnat.dg / array16.adb
1 -- { dg-do compile }
2 -- { dg-options "-O -gnatn -fdump-tree-optimized" }
3
4 package body Array16 is
5
6   function F1 (A : access My_T1) return My_T1 is
7   begin
8     return A.all;
9   end;
10
11   function F2 (A : access My_T2) return My_T2 is
12   begin
13     return A.all;
14   end;
15
16   procedure Proc (A : access My_T1; B : access My_T2) is
17     L1 : My_T1 := F1(A);
18     L2 : My_T2 := F2(B);
19   begin
20     if L1.D = 0 and then L2(1) = 0 then
21       raise Program_Error;
22     end if;
23   end;
24
25 end Array16;
26
27 -- { dg-final { scan-tree-dump-not "secondary_stack" "optimized" } }
28 -- { dg-final { cleanup-tree-dump "optimized" } }