1! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
2! C1134 A CYCLE statement must be within a DO construct
3!
4! C1166 An EXIT statement must be within a DO construct
5
6subroutine s1()
7! this one's OK
8  do i = 1,10
9    cycle
10  end do
11
12! this one's OK
13  do i = 1,10
14    exit
15  end do
16
17! all of these are OK
18  outer: do i = 1,10
19    cycle
20    inner: do j = 1,10
21      cycle
22    end do inner
23    cycle
24  end do outer
25
26!ERROR: No matching DO construct for CYCLE statement
27  cycle
28
29!ERROR: No matching construct for EXIT statement
30  exit
31
32!ERROR: No matching DO construct for CYCLE statement
33  if(.true.) cycle
34
35!ERROR: No matching construct for EXIT statement
36  if(.true.) exit
37
38end subroutine s1
39