[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / blockconstruct01.f90
bloba3759d2aea431380aefccc29f93059069aff69dd
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! C1107 -- COMMON, EQUIVALENCE, INTENT, NAMELIST, OPTIONAL, VALUE or
4 ! STATEMENT FUNCTIONS not allow in specification part
6 subroutine s1_c1107
7 common /nl/x
8 block
9 !ERROR: COMMON statement is not allowed in a BLOCK construct
10 common /nl/y
11 end block
12 end
14 subroutine s2_c1107
15 real x(100), i(5)
16 integer y(100), j(5)
17 equivalence (x, y)
18 block
19 !ERROR: EQUIVALENCE statement is not allowed in a BLOCK construct
20 equivalence (i, j)
21 end block
22 end
24 subroutine s3_c1107(x_in, x_out)
25 integer x_in, x_out
26 intent(in) x_in
27 block
28 !ERROR: INTENT statement is not allowed in a BLOCK construct
29 intent(out) x_out
30 end block
31 end
33 subroutine s4_c1107
34 namelist /nl/x
35 block
36 !ERROR: NAMELIST statement is not allowed in a BLOCK construct
37 namelist /nl/y
38 end block
39 end
41 subroutine s5_c1107(x,y)
42 integer x, y
43 value x
44 block
45 !ERROR: VALUE statement is not allowed in a BLOCK construct
46 value y
47 end block
48 end
50 subroutine s6_c1107(x, y)
51 integer x, y
52 optional x
53 block
54 !ERROR: OPTIONAL statement is not allowed in a BLOCK construct
55 optional y
56 end block
57 end
59 subroutine s7_c1107
60 integer x
61 inc(x) = x + 1
62 block
63 !ERROR: STATEMENT FUNCTION statement is not allowed in a BLOCK construct
64 dec(x) = x - 1
65 end block
66 end