35 lines · plain
1! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s2program main3 type t4 integer, allocatable :: component(:)5 end type6 type(t) :: x7 call init(10)8 !CHECK: PRINT *, [INTEGER(4)::int(lbound(x%component,dim=1,kind=8),kind=4)]9 print *, lbound(x%component)10 !CHECK: PRINT *, [INTEGER(4)::int(size(x%component,dim=1,kind=8)+lbound(x%component,dim=1,kind=8)-1_8,kind=4)]11 print *, ubound(x%component)12 !CHECK: PRINT *, int(size(x%component,dim=1,kind=8),kind=4)13 print *, size(x%component)14 !CHECK: PRINT *, 4_8*size(x%component,dim=1,kind=8)15 print *, sizeof(x%component)16 !CHECK: PRINT *, 1_417 print *, lbound(iota(10), 1)18 !CHECK: PRINT *, ubound(iota(10_4),1_4)19 print *, ubound(iota(10), 1)20 !CHECK: PRINT *, size(iota(10_4))21 print *, size(iota(10))22 !CHECK: PRINT *, sizeof(iota(10_4))23 print *, sizeof(iota(10))24 contains25 function iota(n) result(result)26 integer, intent(in) :: n27 integer, allocatable :: result(:)28 result = [(j,j=1,n)]29 end30 subroutine init(n)31 integer, intent(in) :: n32 allocate(x%component(0:n-1))33 end34end35