OSDN Git Service

* gcc-interface/utils.c (maybe_unconstrained_array): Declare TYPE local
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gnat.dg / array10.adb
1 -- { dg-do run }
2 -- Verify that an array of non-aliased zero-sized element is zero-sized
3
4 procedure Array10 is
5
6   type Rec is null record;
7
8   type Arr1 is array (1..8) of Rec;
9   type Arr2 is array (Long_Integer) of Rec;
10
11   R : Rec;
12   A1 : Arr1;
13   A2 : Arr2;
14
15 begin
16   if Rec'Size /= 0 then
17     raise Program_Error;
18   end if;
19   if Arr1'Size /= 0 then
20     raise Program_Error;
21   end if;
22   if Arr2'Size /= 0 then
23     raise Program_Error;
24   end if;
25 end;