brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · b59fd44 Raw
130 lines · plain
1! RUN: %python %S/test_modfile.py %s %flang_fc12! Test writing procedure bindings in a derived type.3 4module m5  interface6    subroutine a(i, j)7      integer :: i, j8    end subroutine9  end interface10  type, abstract :: t11    integer :: i12  contains13    procedure(a), deferred, nopass :: q14    procedure(b), deferred, nopass :: p, r15  end type16  type t217    integer :: x18  contains19    private20    final :: c21    procedure, non_overridable :: d22  end type23  type, abstract :: t2a24  contains25    procedure(a), deferred, public, nopass :: e26  end type27  type t328    sequence29    integer i30    real x31    double precision y32    double complex z33  end type34contains35  subroutine b()36  end subroutine37  subroutine c(x)38    type(t2) :: x39  end subroutine40  subroutine d(x)41    class(t2) :: x42  end subroutine43  subroutine test44    type(t2) :: x45    call x%d()46  end subroutine47end module48 49!Expect: m.mod50!module m51!  interface52!    subroutine a(i,j)53!      integer(4)::i54!      integer(4)::j55!    end56!  end interface57!  type,abstract::t58!    integer(4)::i59!  contains60!    procedure(a),deferred,nopass::q61!    procedure(b),deferred,nopass::p62!    procedure(b),deferred,nopass::r63!  end type64!  type::t265!    integer(4)::x66!  contains67!    procedure,non_overridable,private::d68!    final::c69!  end type70!  type,abstract::t2a71!  contains72!    procedure(a),deferred,nopass::e73!  end type74!  type::t375!    sequence76!    integer(4)::i77!    real(4)::x78!    real(8)::y79!    complex(8)::z80!  end type81!contains82!  subroutine b()83!  end84!  subroutine c(x)85!    type(t2)::x86!  end87!  subroutine d(x)88!    class(t2)::x89!  end90!  subroutine test()91!  end92!end93 94! Ensure the type is emitted before its use95module m296  private s97  type :: t98  contains99    procedure :: foo100  end type101  abstract interface102    subroutine s(x)103      import104      type(t) :: x105    end subroutine106  end interface107contains108  subroutine foo(x)109    class(t) :: x110  end subroutine111end module112!Expect: m2.mod113!module m2114!  type::t115!  contains116!    procedure::foo117!  end type118!  private::s119!  abstract interface120!    subroutine s(x)121!      import::t122!      type(t)::x123!    end124!  end interface125!contains126!  subroutine foo(x)127!    class(t)::x128!  end129!end130