2 -- { dg-options "-O -fdump-tree-optimized" }
4 procedure Loop_Optimization20
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 Is_Null
(S1
: Obj_T
) return Boolean;
15 pragma No_Inline
(Is_Null
);
17 function Is_Null
(S1
: Obj_T
) return Boolean is
19 for I
in 1 .. S1
.Length
loop
20 if S1
.Elements
(I
) /= 0 then
27 A
: T
:= new Obj_T
'(Length => 10, Elements => (others => 0));
30 if not Is_Null (A.all) then
35 -- { dg-final { scan-tree-dump-not "Index_Check" "optimized" } }