2016-11-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gnat.dg / scalar_mode_agg_compare_loop.adb
blob9bafb4d29bbfe6e702663ab915c6046bc3cbc033
2 -- { dg-do compile }
3 -- { dg-options "-O2 -gnatp" }
5 function Scalar_Mode_Agg_Compare_Loop return Boolean is
6 S : constant String (1 .. 4) := "ABCD";
7 F : constant Natural := S'First;
8 L : constant Natural := S'Last;
9 begin
10 for J in F .. L - 1 loop
11 if S (F .. F) = "X" or (J <= L - 2 and S (J .. J + 1) = "YY") then
12 return True;
13 end if;
14 end loop;
16 return False;
17 end;