102 lines · plain
1!REQUIRES: flang-supports-f128-math2!RUN: %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s3module m4 interface5 integer function ifunc(n)6 integer, intent(in) :: n7 end function8 real function rfunc(x)9 real, intent(in) :: x10 end function11 end interface12 external extrfunc13 real extrfunc14 type :: t1(kind,len)15 integer(kind=1), kind :: kind = 416 integer(kind=2), len :: len = 117 integer(kind=kind) :: j18 real(kind=kind) :: x(2,2)19 complex(kind=kind) :: z20 logical(kind=kind) :: t21 character(kind=5-kind) :: c(2)22 real(kind=kind), pointer :: xp(:,:)23 procedure(ifunc), pointer, nopass :: ifptr24 procedure(rfunc), pointer, nopass :: rp25 procedure(real), pointer, nopass :: xrp26 end type27 contains28 subroutine s129 procedure(ifunc), pointer :: ifptr ! CHECK: ifptr, EXTERNAL, POINTER (Function, InDataStmt) size=8 offset=0: ProcEntity ifunc => ifunc30 data ifptr/ifunc/31 end subroutine32 subroutine s233 integer(kind=1) :: j1 ! CHECK: j1 (InDataStmt) size=1 offset=0: ObjectEntity type: INTEGER(1) init:66_134 data j1/66/35 end subroutine36 subroutine s337 integer :: jd ! CHECK: jd (InDataStmt) size=4 offset=0: ObjectEntity type: INTEGER(4) init:666_438 data jd/666/39 end subroutine40 subroutine s441 logical :: lv(2) ! CHECK: lv (InDataStmt) size=8 offset=0: ObjectEntity type: LOGICAL(4) shape: 1_8:2_8 init:[LOGICAL(4)::.false._4,.true._4]42 data lv(1)/.false./43 data lv(2)/.true./44 end subroutine45 subroutine s546 real :: rm(2,2) ! CHECK: rm (InDataStmt) size=16 offset=0: ObjectEntity type: REAL(4) shape: 1_8:2_8,1_8:2_8 init:reshape([REAL(4)::1._4,2._4,3._4,4._4],shape=[2,2])47 data rm/1,2,3,4/48 end subroutine49 subroutine s650 character(len=8) :: ssd ! CHECK: ssd (InDataStmt) size=8 offset=0: ObjectEntity type: CHARACTER(8_4,1) init:"abcdefgh"51 data ssd(1:4)/'abcd'/,ssd(5:8)/'efgh'/52 end subroutine53 subroutine s754 complex(kind=16) :: zv(-1:1) ! CHECK: zv (InDataStmt) size=96 offset=0: ObjectEntity type: COMPLEX(16) shape: -1_8:1_8 init:[COMPLEX(16)::(1._16,2._16),(3._16,4._16),(5._16,6._16)]55 data (zv(j), j=1,0,-1)/(5,6),(3,4)/56 data (zv(j)%im, zv(j)%re, j=-1,-1,-9)/2,1/57 end subroutine58 real function rfunc2(x)59 real, intent(in) :: x60 rfunc2 = x + 1.61 end function62 subroutine s863 procedure(rfunc), pointer :: rfptr ! CHECK: rfptr, EXTERNAL, POINTER (Function, InDataStmt) size=8 offset=0: ProcEntity rfunc => rfunc264 data rfptr/rfunc2/65 end subroutine66 subroutine s1067 real, target, save :: arr(3,4) ! CHECK: arr, SAVE, TARGET size=48 offset=0: ObjectEntity type: REAL(4) shape: 1_8:3_8,1_8:4_868 real, pointer :: xpp(:,:) ! CHECK: xpp, POINTER (InDataStmt) size=72 offset=48: ObjectEntity type: REAL(4) shape: :,: init:arr69 data xpp/arr/70 end subroutine71 integer function ifunc2(n)72 integer, intent(in) :: n73 ifunc2 = n + 174 end function75 subroutine s1176 real, target, save :: arr(3,4) ! CHECK: arr, SAVE, TARGET size=48 offset=0: ObjectEntity type: REAL(4) shape: 1_8:3_8,1_8:4_877 type(t1) :: d1 = t1(1,reshape([1,2,3,4],[2,2]),(6.,7.),.false.,'ab',arr,ifunc2,rfunc,extrfunc) ! CHECK: d1 size=136 offset=48: ObjectEntity type: TYPE(t1(kind=4_1,len=1_2)) init:t1(kind=4_1,len=1_2)(j=1_4,x=reshape([REAL(4)::1._4,2._4,3._4,4._4],shape=[2,2]),z=(6._4,7._4),t=.false._4,c=[CHARACTER(KIND=1,LEN=1)::"a","a"],xp=arr,ifptr=ifunc2,rp=rfunc,xrp=extrfunc)78 type(t1(4,len=1)) :: d2 = t1(4)(xrp=extrfunc,rp=rfunc,ifptr=ifunc2,xp=arr,c='a&79 &b',t=.false.,z=(6.,7.),x=reshape([1,2,3,4],[2,2]),j=1) ! CHECK: d2 size=136 offset=184: ObjectEntity type: TYPE(t1(kind=4_1,len=1_2)) init:t1(kind=4_1,len=1_2)(j=1_4,x=reshape([REAL(4)::1._4,2._4,3._4,4._4],shape=[2,2]),z=(6._4,7._4),t=.false._4,c=[CHARACTER(KIND=1,LEN=1)::"a","a"],xp=arr,ifptr=ifunc2,rp=rfunc,xrp=extrfunc)80 type(t1(2+2)) :: d3 ! CHECK: d3 (InDataStmt) size=136 offset=320: ObjectEntity type: TYPE(t1(kind=4_1,len=1_2)) init:t1(kind=4_1,len=1_2)(j=1_4,x=reshape([REAL(4)::1._4,2._4,3._4,4._4],shape=[2,2]),z=(6._4,7._4),t=.false._4,c=[CHARACTER(KIND=1,LEN=1)::"a","a"],xp=arr,ifptr=ifunc2,rp=rfunc,xrp=extrfunc)81 data d3/t1(1,reshape([1,2,3,4],[2,2]),(6.,7.),.false.,'ab',arr,ifunc2,rfunc,extrfunc)/82 type(t1) :: d4 ! CHECK: d4 (InDataStmt) size=136 offset=456: ObjectEntity type: TYPE(t1(kind=4_1,len=1_2)) init:t1(kind=4_1,len=1_2)(j=1_4,x=reshape([REAL(4)::1._4,2._4,3._4,4._4],shape=[2,2]),z=(6._4,7._4),t=.false._4,c=[CHARACTER(KIND=1,LEN=1)::"a","a"],xp=arr,ifptr=ifunc2,rp=rfunc,xrp=extrfunc)83 data d4/t1(4)(xrp=extrfunc,rp=rfunc,ifptr=ifunc2,xp=arr,c='ab',t=.false.,z=(6&84 &.,7.),x=reshape([1,2,3,4],[2,2]),j=1)/85 type(t1) :: d5 ! CHECK: d5 (InDataStmt) size=136 offset=592: ObjectEntity type: TYPE(t1(kind=4_1,len=1_2)) init:t1(kind=4_1,len=1_2)(j=1_4,x=reshape([REAL(4)::1._4,2._4,3._4,4._4],shape=[2,2]),z=(6._4,7._4),t=.false._4,c=[CHARACTER(KIND=1,LEN=1)::"a","b"],xp=arr,ifptr=ifunc2,rp=rfunc,xrp=extrfunc)86 data d5%j/1/,d5%x/1,2,3,4/,d5%z%re/6./,d5%z%im/7./,d5%t/.false./,d5%c(1:1)/'a'/,d5%c(2:&87 &2)/'b'/,d5%xp/arr/,d5%ifptr/ifunc2/,d5%rp/rfunc/,d5%xrp/extrfunc/88 end subroutine89 subroutine s1290 procedure(rfunc), pointer :: pp ! CHECK: pp, EXTERNAL, POINTER (Function, InDataStmt) size=8 offset=0: ProcEntity rfunc => rfunc291 data pp/rfunc2/92 end subroutine93 subroutine s1394 integer j(2)95 data j(2:1), j(1:2) /1,2/ ! CHECK: j (InDataStmt) size=8 offset=0: ObjectEntity type: INTEGER(4) shape: 1_8:2_8 init:[INTEGER(4)::1_4,2_4]96 end subroutine97 subroutine s1498 integer j(0:1)99 data (j(modulo(k,2)),k=1,2) /3,4/ ! CHECK: j (InDataStmt) size=8 offset=0: ObjectEntity type: INTEGER(4) shape: 0_8:1_8 init:[INTEGER(4)::4_4,3_4]100 end subroutine101end module102