Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / resolve29.f90
blobea4642c1b3ddc78c5f3cd998c775490eee1119fb
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 module m1
3 type t1
4 end type
5 type t3
6 end type
7 interface
8 subroutine s1(x)
9 !ERROR: 't1' from host is not accessible
10 import :: t1
11 type(t1) :: x
12 integer :: t1
13 end subroutine
14 subroutine s2()
15 !ERROR: 't2' not found in host scope
16 import :: t2
17 end subroutine
18 subroutine s3(x, y)
19 !ERROR: Derived type 't1' not found
20 type(t1) :: x, y
21 end subroutine
22 subroutine s4(x, y)
23 !ERROR: 't3' from host is not accessible
24 import, all
25 type(t1) :: x
26 type(t3) :: y
27 integer :: t3
28 end subroutine
29 end interface
30 contains
31 subroutine s5()
32 end
33 subroutine s6()
34 import, only: s5
35 implicit none(external)
36 call s5()
37 end
38 subroutine s7()
39 import, only: t1
40 implicit none(external)
41 !ERROR: 's5' is an external procedure without the EXTERNAL attribute in a scope with IMPLICIT NONE(EXTERNAL)
42 call s5()
43 end
44 end module
45 module m2
46 integer, parameter :: ck = kind('a')
47 end module
48 program main
49 use m2
50 interface
51 subroutine s0(x)
52 import :: ck
53 character(kind=ck) :: x ! no error
54 end subroutine
55 end interface
56 end program