57 lines · plain
1! Test lowering of derived type with kind parameters2! RUN: bbc -emit-fir %s -o - | FileCheck %s3 4module m5 type t(k1, k2)6 integer(4), kind :: k1 = 77 integer(8), kind :: k28 character(k1) :: c(k2)9 end type10 11 type t2(k1, k2)12 integer(4), kind :: k113 integer(8), kind :: k214 type(t(k1+3, k2+4)) :: at15 end type16 17 type t3(k)18 integer, kind :: k19 type(t3(k)), pointer :: at320 end type21 22 type t4(k)23 integer, kind :: k24 real(-k) :: i25 end type26 27contains28 29! -----------------------------------------------------------------------------30! Test mangling of derived type with kind parameters31! -----------------------------------------------------------------------------32 33 ! CHECK-LABEL: func @_QMmPfoo34 ! CHECK-SAME: !fir.ref<!fir.type<_QMmTtK7K12{c:!fir.array<12x!fir.char<1,7>>35 subroutine foo(at)36 type(t(k2=12)) :: at37 end subroutine38 39 ! CHECK-LABEL: func @_QMmPfoo240 ! CHECK-SAME: !fir.ref<!fir.type<_QMmTt2K12K13{at:!fir.type<_QMmTtK15K17{c:!fir.array<17x!fir.char<1,15>>}>}>>41 subroutine foo2(at2)42 type(t2(12, 13)) :: at243 end subroutine44 45 ! CHECK-LABEL: func @_QMmPfoo346 ! CHECK-SAME: !fir.ref<!fir.type<_QMmTt3K7{at3:!fir.box<!fir.ptr<!fir.type<_QMmTt3K7>>>}>>47 subroutine foo3(at3)48 type(t3(7)) :: at349 end subroutine50 51 ! CHECK-LABEL: func @_QMmPfoo452 ! CHECK-SAME: !fir.ref<!fir.type<_QMmTt4KN4{i:f32}>>53 subroutine foo4(at4)54 type(t4(-4)) :: at455 end subroutine56end module57