| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-std=f2008 -fcoarray=single" } |
| 3 |
|
| 4 |
! PR fortran/44602 |
| 5 |
! Check for compile-time errors with non-loop EXITs. |
| 6 |
|
| 7 |
! Contributed by Daniel Kraft, [email protected]. |
| 8 |
|
| 9 |
PROGRAM main |
| 10 |
IMPLICIT NONE |
| 11 |
INTEGER :: bar(2) |
| 12 |
|
| 13 |
! Must not exit CRITICAL. |
| 14 |
mycrit: CRITICAL |
| 15 |
EXIT mycrit ! { dg-error "leaves CRITICAL" } |
| 16 |
END CRITICAL mycrit |
| 17 |
|
| 18 |
! CYCLE is only allowed for loops! |
| 19 |
myblock: BLOCK |
| 20 |
CYCLE myblock ! { dg-error "is not applicable to non-loop construct 'myblock'" } |
| 21 |
END BLOCK myblock |
| 22 |
|
| 23 |
! Invalid construct. |
| 24 |
! Thanks to Mikael Morin, [email protected]. |
| 25 |
baz: WHERE ([ .true., .true. ]) |
| 26 |
bar = 0 |
| 27 |
EXIT baz ! { dg-error "is not applicable to construct 'baz'" } |
| 28 |
END WHERE baz |
| 29 |
END PROGRAM main |