brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 7c23f73 Raw
205 lines · plain
1! RUN: %python %S/test_modfile.py %s %flang_fc12! Test that subprogram interfaces get all of the symbols that they need.3 4module m15  integer(8) :: i6  type t17    sequence8    integer :: j9  end type10  type t211  end type12end13!Expect: m1.mod14!module m115! integer(8)::i16! type::t117!  sequence18!  integer(4)::j19! end type20! type::t221! end type22!end23 24module m225  integer(8) :: k26contains27  subroutine s(a, j)28    use m129    integer(8) :: j30    real :: a(i:j,1:k)  ! need i from m131  end32end33!Expect: m2.mod34!module m235! integer(8)::k36!contains37! subroutine s(a,j)38!  use m1,only:i39!  integer(8)::j40!  real(4)::a(i:j,1_8:k)41! end42!end43 44module m345  implicit none46contains47  subroutine s(b, n)48    type t249    end type50    type t4(l)51      integer, len :: l52      type(t2) :: x  ! need t253    end type54    integer :: n55    type(t4(n)) :: b56  end57end module58!Expect: m3.mod59!module m360!contains61! subroutine s(b,n)62!  integer(4)::n63!  type::t264!  end type65!  type::t4(l)66!   integer(4),len::l67!   type(t2)::x68!  end type69!  type(t4(l=n))::b70! end71!end72 73module m474contains75  subroutine s1(a)76    use m177    common /c/x,n  ! x is needed78    integer(8) :: n79    real :: a(n)80    type(t1) :: x81  end82end83!Expect: m4.mod84!module m485!contains86! subroutine s1(a)87!  use m1,only:t188!  type(t1)::x89!  common/c/x,n90!  integer(8)::n91!  real(4)::a(1_8:n)92! end93!end94 95module m596  type t597  end type98  interface99    subroutine s(x1,x5)100      use m1101      import :: t5102      type(t1) :: x1103      type(t5) :: x5104    end subroutine105  end interface106end107!Expect: m5.mod108!module m5109! type::t5110! end type111! interface112!  subroutine s(x1,x5)113!   use m1,only:t1114!   import::t5115!   type(t1)::x1116!   type(t5)::x5117!  end118! end interface119!end120 121module m6122contains123  subroutine s(x)124    use m1125    type, extends(t2) :: t6126    end type127    type, extends(t6) :: t7128    end type129    type(t7) :: x130  end131end132!Expect: m6.mod133!module m6134!contains135! subroutine s(x)136!  use m1,only:t2137!  type,extends(t2)::t6138!  end type139!  type,extends(t6)::t7140!  end type141!  type(t7)::x142! end143!end144 145module m7146  type :: t5(l)147    integer, len :: l148  end type149contains150  subroutine s1(x)151    use m1152    type(t5(i)) :: x153  end subroutine154  subroutine s2(x)155    use m1156    character(i) :: x157  end subroutine158end159!Expect: m7.mod160!module m7161! type::t5(l)162!  integer(4),len::l163! end type164!contains165! subroutine s1(x)166!  use m1,only:i167!  type(t5(l=int(i,kind=4)))::x168! end169! subroutine s2(x)170!  use m1,only:i171!  character(i,1)::x172! end173!end174 175module m8176  use m1, only: t1, t2177  interface178    subroutine s1(x)179      import180      type(t1) :: x181    end subroutine182    subroutine s2(x)183      import :: t2184      type(t2) :: x185    end subroutine186  end interface187end188!Expect: m8.mod189!module m8190! use m1,only:t1191! use m1,only:t2192! interface193!  subroutine s1(x)194!   import::t1195!   type(t1)::x196!  end197! end interface198! interface199!  subroutine s2(x)200!   import::t2201!   type(t2)::x202!  end203! end interface204!end205