1! RUN: %S/test_modfile.sh %s %f18 %t
2! modfile with subprograms
3
4module m1
5  type :: t
6  end type
7contains
8
9  pure subroutine s(x, y) bind(c)
10    logical x
11    intent(inout) y
12    intent(in) x
13  end subroutine
14
15  real function f1() result(x)
16    x = 1.0
17  end function
18
19  function f2(y)
20    complex y
21    f2 = 2.0
22  end function
23
24end
25
26module m2
27contains
28  type(t) function f3(x)
29    use m1
30    integer, parameter :: a = 2
31    type t2(b)
32      integer, kind :: b = a
33      integer :: y
34    end type
35    type(t2) :: x
36  end
37  function f4() result(x)
38    implicit complex(x)
39  end
40end
41
42!Expect: m1.mod
43!module m1
44!type::t
45!end type
46!contains
47!pure subroutine s(x,y) bind(c)
48!logical(4),intent(in)::x
49!real(4),intent(inout)::y
50!end
51!function f1() result(x)
52!real(4)::x
53!end
54!function f2(y)
55!complex(4)::y
56!real(4)::f2
57!end
58!end
59
60!Expect: m2.mod
61!module m2
62!contains
63!function f3(x)
64! use m1,only:t
65! type::t2(b)
66!  integer(4),kind::b=2_4
67!  integer(4)::y
68! end type
69! type(t2(b=2_4))::x
70! type(t)::f3
71!end
72!function f4() result(x)
73!complex(4)::x
74!end
75!end
76