Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / blockconstruct01.f90
blob3b0a343b15d51624c92f753c6b245052057a5cea
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! C1107 -- COMMON, EQUIVALENCE, INTENT, NAMELIST, OPTIONAL, VALUE or
3 ! STATEMENT FUNCTIONS not allow in specification part
5 subroutine s1_c1107
6 common /nl/x
7 block
8 !ERROR: COMMON statement is not allowed in a BLOCK construct
9 common /nl/y
10 end block
11 end
13 subroutine s2_c1107
14 real x(100), i(5)
15 integer y(100), j(5)
16 equivalence (x, y)
17 block
18 !ERROR: EQUIVALENCE statement is not allowed in a BLOCK construct
19 equivalence (i, j)
20 end block
21 end
23 subroutine s3_c1107(x_in, x_out)
24 integer x_in, x_out
25 intent(in) x_in
26 block
27 !ERROR: INTENT statement is not allowed in a BLOCK construct
28 intent(out) x_out
29 end block
30 end
32 subroutine s4_c1107
33 namelist /nl/x
34 block
35 !ERROR: NAMELIST statement is not allowed in a BLOCK construct
36 namelist /nl/y
37 end block
38 end
40 subroutine s5_c1107(x,y)
41 integer x, y
42 value x
43 block
44 !ERROR: VALUE statement is not allowed in a BLOCK construct
45 value y
46 end block
47 end
49 subroutine s6_c1107(x, y)
50 integer x, y
51 optional x
52 block
53 !ERROR: OPTIONAL statement is not allowed in a BLOCK construct
54 optional y
55 end block
56 end
58 subroutine s7_c1107
59 integer x, arr(1)
60 inc(x) = x + 1
61 block
62 !ERROR: A statement function definition may not appear in a BLOCK construct
63 dec(x) = x - 1
64 arr(x) = x - 1 ! ok
65 end block
66 end