aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/array15.adb
blob: eb51f37c5ae52128d1ccda286071202ad4bd496a (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
-- { dg-do compile }
-- { dg-options "-O -gnatws" }

package body Array15 is

   type Arr is array (Natural range <>) of Integer;

   Table : Arr (1 .. 4);

   N : Natural := 1;

   procedure Zero is
   begin
      N := 0;
   end;

   function F (I : Integer) return Integer is
      A1 : Arr := (1 => I);
      A2 : Arr := Table (1 .. N) & A1;
   begin
      return A2 (I);
   end;

end Array15;