2016-11-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gnat.dg / loop_optimization16.adb
blobb9f2b70bb45319e9362555c0c8f5acef12a3fd2b
1 -- { dg-do run }
3 with Loop_Optimization16_Pkg; use Loop_Optimization16_Pkg;
5 procedure Loop_Optimization16 is
7 Counter : Natural := 0;
9 C : constant Natural := F;
11 subtype Index_T is Index_Base range 1 .. Index_Base (C);
13 begin
15 for I in Index_T'First .. Index_T'Last loop
16 Counter := Counter + 1;
17 exit when Counter > 200;
18 end loop;
20 if Counter > 200 then
21 raise Program_Error;
22 end if;
24 end Loop_Optimization16;