Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / gnat.dg / opt2.adb
bloba6c247fdb9be6bc8315b4dc89af666646b5c4e16
1 -- { dg-do run }
2 -- { dg-options "-O2 -fno-inline" }
4 procedure Opt2 is
5 function Get return String is
6 begin
7 return "[]";
8 end Get;
10 Message : String := Get;
12 F, L : Integer;
13 begin
14 for J in Message'Range loop
15 if Message (J) = '[' then
16 F := J;
17 elsif Message (J) = ']' then
18 L := J;
19 exit;
20 end if;
21 end loop;
23 declare
24 M : String :=
25 Message (Message'First .. F) & Message (L .. Message'Last);
26 begin
27 if M /= "[]" then
28 raise Program_Error;
29 end if;
30 end;
31 end;