URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 304 |
Rev 384 |
-- { dg-do compile }
|
-- { dg-do compile }
|
-- { dg-options "-O -gnatp" }
|
-- { dg-options "-O -gnatp" }
|
|
|
with Loop_Optimization5_Pkg; use Loop_Optimization5_Pkg;
|
with Loop_Optimization5_Pkg; use Loop_Optimization5_Pkg;
|
|
|
procedure Loop_Optimization5 is
|
procedure Loop_Optimization5 is
|
Str : constant String := "12345678";
|
Str : constant String := "12345678";
|
Cmd : constant String := Init;
|
Cmd : constant String := Init;
|
StartP : Positive := Cmd'First;
|
StartP : Positive := Cmd'First;
|
StartS : Positive := Cmd'Last + 1;
|
StartS : Positive := Cmd'Last + 1;
|
EndP : Natural := StartP - 1;
|
EndP : Natural := StartP - 1;
|
Full_Cmd : String_Access;
|
Full_Cmd : String_Access;
|
begin
|
begin
|
for J in StartP .. Cmd'Last - Str'Length + 1 loop
|
for J in StartP .. Cmd'Last - Str'Length + 1 loop
|
if Cmd (J .. J + Str'Length - 1) = Str then
|
if Cmd (J .. J + Str'Length - 1) = Str then
|
EndP := J - 1;
|
EndP := J - 1;
|
exit;
|
exit;
|
end if;
|
end if;
|
end loop;
|
end loop;
|
Full_Cmd := Locate (Cmd (StartP .. EndP));
|
Full_Cmd := Locate (Cmd (StartP .. EndP));
|
end;
|
end;
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.