OSDN Git Service

* gcc-interface/decl.c (make_type_from_size) <INTEGER_TYPE>: Just copy
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gnat.dg / loop_optimization5.adb
1 -- { dg-do compile }
2 -- { dg-options "-O -gnatp" }
3
4 with Loop_Optimization5_Pkg; use Loop_Optimization5_Pkg;
5
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;
13 begin
14    for J in StartP .. Cmd'Last - Str'Length + 1 loop
15       if Cmd (J .. J + Str'Length - 1) = Str then
16          EndP := J - 1;
17          exit;
18       end if;
19    end loop;
20    Full_Cmd := Locate (Cmd (StartP .. EndP));
21 end;