71 lines · plain
1!RUN: %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s2 3! Size and alignment of derived types4 5! Array of derived type with 64-bit alignment6subroutine s17 type t18 real(8) :: a9 real(4) :: b10 end type11 type t212 type(t1) c13 real(4) d14 end type15 !CHECK: x1 size=16 offset=0:16 !CHECK: y1 size=16 offset=16:17 type(t1) :: x1, y118 !CHECK: z1 size=160 offset=32:19 type(t1) :: z1(10)20 !CHECK: z2 size=24 offset=19221 type(t2) z222end23 24! Like t1 but t2 does not need to be aligned on 64-bit boundary25subroutine s226 type t227 real(4) :: a28 real(4) :: b29 real(4) :: c30 end type31 !CHECK: x2 size=12 offset=0:32 !CHECK: y2 size=12 offset=12:33 type(t2) :: x2, y234 !CHECK: z2 size=120 offset=24:35 type(t2) :: z2(10)36end37 38! Parameterized derived types39subroutine s340 type :: t(k, l)41 integer, kind :: k42 integer, len :: l43 real(k) :: a344 integer(kind=k) :: b345 character(kind=k, len=8) :: c346 character(kind=k, len=l) :: d347 end type48 !CHECK: DerivedType scope: size=48 alignment=8 instantiation of t(k=2_4,l=10_4)49 !CHECK: a3 size=2 offset=0:50 !CHECK: b3 size=2 offset=2:51 !CHECK: c3 size=16 offset=4:52 !CHECK: d3 size=24 offset=24:53 type(t(2, 10)) :: x354 !CHECK: DerivedType scope: size=64 alignment=8 instantiation of t(k=4_4,l=20_4)55 !CHECK: a3 size=4 offset=0:56 !CHECK: b3 size=4 offset=4:57 !CHECK: c3 size=32 offset=8:58 !CHECK: d3 size=24 offset=40:59 type(t(4, 20)) :: x460end61 62subroutine s463 type t(k)64 integer, kind :: k65 character(len=k) :: c66 end type67 type(t(7)) :: x468 !CHECK: DerivedType scope: size=7 alignment=1 instantiation of t(k=7_4)69 !CHECK: c size=7 offset=0: ObjectEntity type: CHARACTER(7_4,1)70end subroutine71