2021-09-06 16:19:20 +08:00
|
|
|
! RUN: %python %S/test_errors.py %s %flang_fc1
|
2019-08-27 07:26:24 +08:00
|
|
|
! C1134 A CYCLE statement must be within a DO construct
|
|
|
|
!
|
|
|
|
! C1166 An EXIT statement must be within a DO construct
|
|
|
|
|
|
|
|
subroutine s1()
|
2019-08-30 07:02:37 +08:00
|
|
|
! this one's OK
|
|
|
|
do i = 1,10
|
|
|
|
cycle
|
|
|
|
end do
|
|
|
|
|
|
|
|
! this one's OK
|
|
|
|
do i = 1,10
|
|
|
|
exit
|
|
|
|
end do
|
|
|
|
|
|
|
|
! all of these are OK
|
|
|
|
outer: do i = 1,10
|
|
|
|
cycle
|
|
|
|
inner: do j = 1,10
|
|
|
|
cycle
|
|
|
|
end do inner
|
|
|
|
cycle
|
|
|
|
end do outer
|
|
|
|
|
2019-09-24 11:46:45 +08:00
|
|
|
!ERROR: No matching DO construct for CYCLE statement
|
2019-08-27 07:26:24 +08:00
|
|
|
cycle
|
|
|
|
|
2019-09-23 01:01:03 +08:00
|
|
|
!ERROR: No matching construct for EXIT statement
|
2019-08-27 07:26:24 +08:00
|
|
|
exit
|
|
|
|
|
2019-09-24 11:46:45 +08:00
|
|
|
!ERROR: No matching DO construct for CYCLE statement
|
2019-08-27 07:26:24 +08:00
|
|
|
if(.true.) cycle
|
|
|
|
|
2019-09-23 01:01:03 +08:00
|
|
|
!ERROR: No matching construct for EXIT statement
|
2019-08-27 07:26:24 +08:00
|
|
|
if(.true.) exit
|
|
|
|
|
|
|
|
end subroutine s1
|