2 -- { dg-options "-O -gnatp" }
4 with Loop_Optimization5_Pkg; use Loop_Optimization5_Pkg;
6 procedure Loop_Optimization5 is
7 Str : constant String := "12345678";
8 Cmd : constant String := Init;
9 StartP : Positive := Cmd'First;
10 StartS : Positive := Cmd'Last + 1;
11 EndP : Natural := StartP - 1;
12 Full_Cmd : String_Access;
14 for J in StartP .. Cmd'Last - Str'Length + 1 loop
15 if Cmd (J .. J + Str'Length - 1) = Str then
20 Full_Cmd := Locate (Cmd (StartP .. EndP));