1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! C1167 -- An exit-stmt shall not appear within a DO CONCURRENT construct if
3 ! it belongs to that construct or an outer construct.
5 subroutine do_concurrent_test1(n
)
7 integer :: i1
,i2
,i3
,i4
,i5
,i6
,n
9 nc1
: do concurrent(i1
=1:n
)
11 nc3
: do concurrent(i3
=1:n
)
13 nc5
: do concurrent(i5
=1:n
)
15 !ERROR: EXIT must not leave a DO CONCURRENT statement
16 !ERROR: EXIT must not leave a DO CONCURRENT statement
17 !ERROR: EXIT must not leave a DO CONCURRENT statement
18 if (i6
==10) exit mytest1
26 end subroutine do_concurrent_test1
28 subroutine do_concurrent_test2(n
)
30 integer :: i1
,i2
,i3
,i4
,i5
,i6
,n
31 mytest2
: if (n
>0) then
32 nc1
: do concurrent(i1
=1:n
)
34 nc3
: do concurrent(i3
=1:n
)
36 nc5
: do concurrent(i5
=1:n
)
38 !ERROR: EXIT must not leave a DO CONCURRENT statement
39 !ERROR: EXIT must not leave a DO CONCURRENT statement
48 end subroutine do_concurrent_test2
50 subroutine do_concurrent_test3(n
)
52 integer :: i1
,i2
,i3
,i4
,i5
,i6
,n
53 mytest3
: if (n
>0) then
54 nc1
: do concurrent(i1
=1:n
)
56 nc3
: do concurrent(i3
=1:n
)
57 !ERROR: EXIT must not leave a DO CONCURRENT statement
60 nc5
: do concurrent(i5
=1:n
)
62 if (i6
==10) print *, "hello"
70 end subroutine do_concurrent_test3