xref: /llvm-project/flang/test/Semantics/resolve28.f90 (revision 6c1ac141d3c98af9738bc77fcb55602cbff7751f)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2subroutine 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
27end
28
29module m
30  !ERROR: IMPORT is not allowed in a module scoping unit
31  import, none
32end
33
34submodule(m) sub1
35  import, all !OK
36end
37
38submodule(m) sub2
39  !ERROR: IMPORT,NONE is not allowed in a submodule scoping unit
40  import, none
41end
42
43function f
44  !ERROR: IMPORT is not allowed in an external subprogram scoping unit
45  import, all
46end
47
48subroutine sub2()
49  block
50    import, all !OK
51  end block
52end
53
54!ERROR: IMPORT is not allowed in a main program scoping unit
55import
56end
57