P0329R4: Designated Initialization
[official-gcc.git] / gcc / testsuite / gnat.dg / opt63.adb
blob6471be40bbdc4fcb72f0e1aaa132df87cf838906
1 -- { dg-do compile }
2 -- { dg-options "-O -gnatws" }
4 procedure Opt63 is
6 type T_MOD is mod 2**32;
7 subtype T_INDEX is T_MOD range 3_000_000_000 .. 4_000_000_000;
8 type T_ARRAY is array(T_INDEX range <>) of INTEGER;
10 function Build_Crash(First : T_INDEX; Length : NATURAL) return T_ARRAY is
11 R : T_ARRAY(First .. T_Index'Val (T_Index'Pos (First) + Length))
12 := (others => -1); -- Crash here
13 begin
14 return R;
15 end;
17 begin
18 null;
19 end;