1! RUN: %S/test_errors.sh %s %t %flang_fc1
2! REQUIRES: shell
3subroutine s
4  type t
5  end type
6  interface
7    subroutine s1
8      import, none
9      !ERROR: IMPORT,NONE must be the only IMPORT statement in a scope
10      import, all
11    end subroutine
12    subroutine s2
13      import :: t
14      !ERROR: IMPORT,NONE must be the only IMPORT statement in a scope
15      import, none
16    end subroutine
17    subroutine s3
18      import, all
19      !ERROR: IMPORT,ALL must be the only IMPORT statement in a scope
20      import :: t
21    end subroutine
22    subroutine s4
23      import :: t
24      !ERROR: IMPORT,ALL must be the only IMPORT statement in a scope
25      import, all
26    end subroutine
27  end interface
28end
29
30module m
31  !ERROR: IMPORT is not allowed in a module scoping unit
32  import, none
33end
34
35submodule(m) sub1
36  import, all !OK
37end
38
39submodule(m) sub2
40  !ERROR: IMPORT,NONE is not allowed in a submodule scoping unit
41  import, none
42end
43
44function f
45  !ERROR: IMPORT is not allowed in an external subprogram scoping unit
46  import, all
47end
48
49subroutine sub2()
50  block
51    import, all !OK
52  end block
53end
54
55!ERROR: IMPORT is not allowed in a main program scoping unit
56import
57end
58