[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / critical03.f90
blob0683a842d8315fe5901897d0691b5852bc3c8a5e
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 !C1119
5 subroutine test1(a, i)
6 integer i
7 real a(10)
8 critical
9 if (a(i) < 0.0) then
10 a(i) = 20.20
11 !ERROR: Control flow escapes from CRITICAL
12 goto 20
13 end if
14 end critical
15 20 a(i) = -a(i)
16 end subroutine test1
18 subroutine test2(i)
19 integer i
20 critical
21 !ERROR: Control flow escapes from CRITICAL
22 if (i) 10, 10, 20
23 10 i = i + 1
24 end critical
25 20 i = i - 1
26 end subroutine test2
28 subroutine test3(i)
29 integer i
30 critical
31 !ERROR: Control flow escapes from CRITICAL
32 goto (10, 10, 20) i
33 10 i = i + 1
34 end critical
35 20 i = i - 1
36 end subroutine test3