Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / modfile44.f90
blobd0402b5678808b95d1b74fc5c272f9a7d08875fd
1 ! RUN: %python %S/test_modfile.py %s %flang_fc1
2 ! Ensure that m2.mod explicitly USEs a generic interface from m1
3 ! so it can utilize its shadowed derived type.
4 module m1
5 implicit none
6 type :: xyz
7 integer :: n
8 end type
9 interface xyz
10 module procedure xzy
11 end interface
12 contains
13 function xzy(j) result(res)
14 integer, intent(in) :: j
15 type(xyz) :: res
16 res%n = j
17 end function
18 end module
20 !Expect: m1.mod
21 !module m1
22 !interface xyz
23 !procedure::xzy
24 !end interface
25 !type::xyz
26 !integer(4)::n
27 !end type
28 !contains
29 !function xzy(j) result(res)
30 !integer(4),intent(in)::j
31 !type(xyz)::res
32 !end
33 !end
35 module m2
36 implicit none
37 contains
38 function foo(j) result(res)
39 use :: m1, only: xyz
40 integer, intent(in) :: j
41 type(xyz) :: res
42 res = xyz(j)
43 end function
44 end module
46 !Expect: m2.mod
47 !module m2
48 !contains
49 !function foo(j) result(res)
50 !use m1,only:xyz
51 !integer(4),intent(in)::j
52 !type(xyz)::res
53 !end
54 !end