gcc/testsuite/gnat.dg/loop_invariant1.adb
raw| 1 | -- { dg-do compile } |
| 2 | -- { dg-options "-gnata" } |
| 3 | |
| 4 | package body Loop_Invariant1 is |
| 5 | |
| 6 | procedure Proc (A : Arr; N : Integer) is |
| 7 | I : Integer := A'First; |
| 8 | begin |
| 9 | while i <= A'Last and then A(A'First .. A'Last) /= A loop |
| 10 | pragma Loop_Invariant (N = N'Loop_Entry); |
| 11 | i := i + 1; |
| 12 | end loop; |
| 13 | end; |
| 14 | |
| 15 | end Loop_Invariant1; |