llvm/flang/test/Semantics/modfile22.f90
peter klausler 4cbfd93a59 [flang] Make TypeParamInquiry monomorphic
Change the expression representation TypeParamInquiry from being
a class that's templatized on the integer KIND of its result into
a monomorphic representation that results in a SubscriptInteger
that can then be converted.

This is a minor simplification, but it's worth doing because
it is believed to also be a work-around for bugs in the MSVC
compiler with overload resolution that affect the expression
traversal framework.

Differential Revision: https://reviews.llvm.org/D86551
2020-08-31 15:40:40 -07:00

24 lines
652 B
Fortran

! RUN: %S/test_modfile.sh %s %t %f18
! Test character length conversions in constructors
module m
type :: t(k)
integer, kind :: k = 1
character(kind=k,len=1) :: a
character(kind=k,len=3) :: b
end type t
type(t), parameter :: p = t(k=1)(a='xx',b='xx')
character(len=2), parameter :: c2(3) = [character(len=2) :: 'x', 'xx', 'xxx']
end module m
!Expect: m.mod
!module m
!type::t(k)
!integer(4),kind::k=1_4
!character(1_4,int(int(k,kind=4),kind=8))::a
!character(3_4,int(int(k,kind=4),kind=8))::b
!end type
!type(t(k=1_4)),parameter::p=t(k=1_4)(a="x",b="xx ")
!character(2_4,1),parameter::c2(1_8:3_8)=[CHARACTER(KIND=1,LEN=2)::"x ","xx","xx"]
!end