2 -- { dg-options "-O -fdump-tree-optimized" }
4 procedure Loop_Optimization19
is
6 type Array_T
is array (Positive range <>) of Integer;
7 type Obj_T
(Length
: Natural) is
9 Elements
: Array_T
(1 .. Length
);
12 type T
is access Obj_T
;
14 function Equal
(S1
, S2
: T
) return Boolean;
15 pragma No_Inline
(Equal
);
17 function Equal
(S1
, S2
: T
) return Boolean is
19 if S1
.Length
= S2
.Length
then
20 for I
in 1 .. S1
.Length
loop
21 if S1
.Elements
(I
) /= S2
.Elements
(I
) then
31 A
: T
:= new Obj_T
(Length
=> 10);
32 B
: T
:= new Obj_T
(Length
=> 20);
33 C
: T
:= new Obj_T
(Length
=> 30);
45 -- { dg-final { scan-tree-dump-not "Index_Check" "optimized" } }