PR ipa/83051
[official-gcc.git] / gcc / testsuite / gnat.dg / empty_vector_length.adb
blob256a254e2e25f58f04483e7587ec0638ce20fff5
1 -- { dg-do run }
2 -- { dg-options "-gnatp" }
4 procedure Empty_Vector_Length is
6 type Vector is array (Integer range <>) of Integer;
8 function Empty_Vector return Vector is
9 begin
10 return (2 .. Integer'First => 0);
11 end;
13 My_Vector : Vector := Empty_Vector;
14 My_Length : Integer := My_Vector'Length;
15 begin
16 if My_Length /= 0 then
17 raise Program_Error;
18 end if;
19 end;