1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
|
! RUN: %python %S/test_modfile.py %s %flang_fc1
! Test that subprogram interfaces get all of the symbols that they need.
module m1
integer(8) :: i
type t1
sequence
integer :: j
end type
type t2
end type
end
!Expect: m1.mod
!module m1
! integer(8)::i
! type::t1
! sequence
! integer(4)::j
! end type
! type::t2
! end type
!end
module m2
integer(8) :: k
contains
subroutine s(a, j)
use m1
integer(8) :: j
real :: a(i:j,1:k) ! need i from m1
end
end
!Expect: m2.mod
!module m2
! integer(8)::k
!contains
! subroutine s(a,j)
! use m1,only:i
! integer(8)::j
! real(4)::a(i:j,1_8:k)
! end
!end
module m3
implicit none
contains
subroutine s(b, n)
type t2
end type
type t4(l)
integer, len :: l
type(t2) :: x ! need t2
end type
integer :: n
type(t4(n)) :: b
end
end module
!Expect: m3.mod
!module m3
!contains
! subroutine s(b,n)
! integer(4)::n
! type::t2
! end type
! type::t4(l)
! integer(4),len::l
! type(t2)::x
! end type
! type(t4(l=n))::b
! end
!end
module m4
contains
subroutine s1(a)
use m1
common /c/x,n ! x is needed
integer(8) :: n
real :: a(n)
type(t1) :: x
end
end
!Expect: m4.mod
!module m4
!contains
! subroutine s1(a)
! use m1,only:t1
! type(t1)::x
! common/c/x,n
! integer(8)::n
! real(4)::a(1_8:n)
! end
!end
module m5
type t5
end type
interface
subroutine s(x1,x5)
use m1
import :: t5
type(t1) :: x1
type(t5) :: x5
end subroutine
end interface
end
!Expect: m5.mod
!module m5
! type::t5
! end type
! interface
! subroutine s(x1,x5)
! use m1,only:t1
! import::t5
! type(t1)::x1
! type(t5)::x5
! end
! end interface
!end
module m6
contains
subroutine s(x)
use m1
type, extends(t2) :: t6
end type
type, extends(t6) :: t7
end type
type(t7) :: x
end
end
!Expect: m6.mod
!module m6
!contains
! subroutine s(x)
! use m1,only:t2
! type,extends(t2)::t6
! end type
! type,extends(t6)::t7
! end type
! type(t7)::x
! end
!end
module m7
type :: t5(l)
integer, len :: l
end type
contains
subroutine s1(x)
use m1
type(t5(i)) :: x
end subroutine
subroutine s2(x)
use m1
character(i) :: x
end subroutine
end
!Expect: m7.mod
!module m7
! type::t5(l)
! integer(4),len::l
! end type
!contains
! subroutine s1(x)
! use m1,only:i
! type(t5(l=int(i,kind=4)))::x
! end
! subroutine s2(x)
! use m1,only:i
! character(i,1)::x
! end
!end
module m8
use m1, only: t1, t2
interface
subroutine s1(x)
import
type(t1) :: x
end subroutine
subroutine s2(x)
import :: t2
type(t2) :: x
end subroutine
end interface
end
!Expect: m8.mod
!module m8
! use m1,only:t1
! use m1,only:t2
! interface
! subroutine s1(x)
! import::t1
! type(t1)::x
! end
! end interface
! interface
! subroutine s2(x)
! import::t2
! type(t2)::x
! end
! end interface
!end
|