* tree-ssa-sccvn.c (ao_ref_init_from_vn_reference): Use offset_int for
[official-gcc.git] / gcc / testsuite / gnat.dg / opt49.adb
blob4b91973a19d3472e2299be35af35172eedc27255
1 -- { dg-do run }
2 -- { dg-options "-O -fstack-check" }
4 procedure Opt49 is
6 function Ident (I : Integer) return Integer;
7 pragma No_Inline (Ident);
9 function Ident (I : Integer) return Integer is
10 begin
11 return I;
12 end;
14 Int_0 : Integer := Ident (0);
15 Int_4 : Integer := Ident (4);
17 A : array (-4 .. Int_4) of Integer;
19 begin
20 A := (-4 , -3 , -2 , -1 , 100 , 1 , 2 , 3 , 4);
21 A (-4 .. Int_0) := A (Int_0 .. 4);
22 if A /= (100 , 1 , 2 , 3 , 4 , 1 , 2 , 3 , 4) then
23 raise Program_Error;
24 end if;
26 A := (-4 , -3 , -2 , -1 , 100 , 1 , 2 , 3 , 4);
27 A (Int_0 .. 4) := A (-4 .. Int_0);
28 if A /= (-4 , -3 , -2 , -1 , -4 , -3 , -2 , -1 , 100) then
29 raise Program_Error;
30 end if;
31 end;