Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / resolve28.f90
blobd04e60aaf4f5c482be186aecd2a5ef7b420e30fd
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 subroutine s
3 type t
4 end type
5 interface
6 subroutine s1
7 import, none
8 !ERROR: IMPORT,NONE must be the only IMPORT statement in a scope
9 import, all
10 end subroutine
11 subroutine s2
12 import :: t
13 !ERROR: IMPORT,NONE must be the only IMPORT statement in a scope
14 import, none
15 end subroutine
16 subroutine s3
17 import, all
18 !ERROR: IMPORT,ALL must be the only IMPORT statement in a scope
19 import :: t
20 end subroutine
21 subroutine s4
22 import :: t
23 !ERROR: IMPORT,ALL must be the only IMPORT statement in a scope
24 import, all
25 end subroutine
26 end interface
27 end
29 module m
30 !ERROR: IMPORT is not allowed in a module scoping unit
31 import, none
32 end
34 submodule(m) sub1
35 import, all !OK
36 end
38 submodule(m) sub2
39 !ERROR: IMPORT,NONE is not allowed in a submodule scoping unit
40 import, none
41 end
43 function f
44 !ERROR: IMPORT is not allowed in an external subprogram scoping unit
45 import, all
46 end
48 subroutine sub2()
49 block
50 import, all !OK
51 end block
52 end
54 !ERROR: IMPORT is not allowed in a main program scoping unit
55 import
56 end