view gcc/testsuite/gnat.dg/loop_optimization16.adb @ 127:4c56639505ff

fix function.c and add CbC-example Makefile
author mir3636
date Wed, 11 Apr 2018 18:46:58 +0900
parents 04ced10e8804
children
line wrap: on
line source

-- { dg-do run }

with Loop_Optimization16_Pkg; use Loop_Optimization16_Pkg;

procedure Loop_Optimization16 is

   Counter : Natural := 0;

   C : constant Natural := F;

   subtype Index_T is Index_Base range 1 .. Index_Base (C);

begin

   for I in Index_T'First .. Index_T'Last loop
      Counter := Counter + 1;
      exit when Counter > 200;
   end loop;

   if Counter > 200 then
      raise Program_Error;
   end if;

end Loop_Optimization16;