gcc/testsuite/gnat.dg/loop_optimization15.adb
raw| 1 | -- { dg-do compile } |
| 2 | -- { dg-options "-O3" } |
| 3 | |
| 4 | package body Loop_Optimization15 is |
| 5 | |
| 6 | type Integer_Array_T is array (B16_T range <>) of Integer; |
| 7 | |
| 8 | Len : constant B16_T := 10; |
| 9 | |
| 10 | Src : constant Integer_Array_T (1 .. Len) := (others => 0); |
| 11 | Dst : Integer_Array_T (1 .. Len); |
| 12 | |
| 13 | procedure Proc (L : B16_T) is |
| 14 | begin |
| 15 | for I in 1 .. B16_T'Min (L, Len) loop |
| 16 | Dst (I) := Src (I); |
| 17 | end loop; |
| 18 | end; |
| 19 | |
| 20 | end Loop_Optimization15; |