2020-05-12 02:38:53 +08:00
|
|
|
! RUN: %S/test_modfile.sh %s %t %f18
|
2019-08-13 05:06:06 +08:00
|
|
|
! Test modfiles for entities with initialization
|
2019-02-09 08:03:23 +08:00
|
|
|
module m
|
|
|
|
integer, parameter :: k8 = 8
|
|
|
|
integer(8), parameter :: k4 = k8/2
|
|
|
|
integer, parameter :: k1 = 1
|
|
|
|
integer(k8), parameter :: i = 2_k8
|
|
|
|
real :: r = 2.0_k4
|
|
|
|
character(10, kind=k1) :: c = k1_"asdf"
|
2019-08-13 05:06:06 +08:00
|
|
|
character(10), parameter :: c2 = k1_"qwer"
|
|
|
|
complex*16, parameter :: z = (1.0_k8, 2.0_k8)
|
2019-12-03 23:52:18 +08:00
|
|
|
complex*16, parameter :: zn = (-1.0_k8, 2.0_k8)
|
2019-08-13 05:06:06 +08:00
|
|
|
type t
|
|
|
|
integer :: a = 123
|
|
|
|
type(t), pointer :: b => null()
|
|
|
|
end type
|
|
|
|
type(t), parameter :: x = t(456)
|
|
|
|
type(t), parameter :: y = t(789, null())
|
2019-02-09 08:03:23 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
!Expect: m.mod
|
|
|
|
!module m
|
|
|
|
! integer(4),parameter::k8=8_4
|
2019-05-14 00:33:18 +08:00
|
|
|
! integer(8),parameter::k4=4_8
|
2019-02-09 08:03:23 +08:00
|
|
|
! integer(4),parameter::k1=1_4
|
|
|
|
! integer(8),parameter::i=2_8
|
2019-08-13 05:06:06 +08:00
|
|
|
! real(4)::r
|
|
|
|
! character(10_4,1)::c
|
2020-03-18 03:35:31 +08:00
|
|
|
! character(10_4,1),parameter::c2="qwer "
|
2019-08-13 05:06:06 +08:00
|
|
|
! complex(8),parameter::z=(1._8,2._8)
|
2019-12-03 23:52:18 +08:00
|
|
|
! complex(8),parameter::zn=(-1._8,2._8)
|
2019-08-13 05:06:06 +08:00
|
|
|
! type::t
|
|
|
|
! integer(4)::a=123_4
|
|
|
|
! type(t),pointer::b=>NULL()
|
|
|
|
! end type
|
|
|
|
! type(t),parameter::x=t(a=456_4,b=NULL())
|
|
|
|
! type(t),parameter::y=t(a=789_4,b=NULL())
|
2019-12-26 04:29:50 +08:00
|
|
|
! intrinsic::null
|
2019-02-09 08:03:23 +08:00
|
|
|
!end
|