40 lines · plain
1! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s2subroutine test_storage_size(n)3 interface4 function return_char(l)5 integer :: l6 character(l) :: return_char7 end function8 end interface9 integer n10 !CHECK: PRINT *, storage_size(return_char(n))11 print*, storage_size(return_char(n))12 !CHECK: PRINT *, sizeof(return_char(n))13 print*, sizeof(return_char(n))14end subroutine15 16module pdts17 type t(l)18 integer, len :: l19 character(l) :: c20 end type21contains22 function return_pdt(n)23 type(t(n)) :: return_pdt24 end function25 subroutine test(k)26 ! NOTE: flang design for length parametrized derived type27 ! is to use allocatables for the automatic components. Hence,28 ! their size is independent from the length parameters and is29 ! a compile time constant.30 !CHECK: PRINT *, 192_431 print *, storage_size(return_pdt(k))32 end subroutine33end module34 35subroutine test_assumed_rank(x)36 real :: x(..)37 !CHECK: PRINT *, sizeof(x)38 print *, sizeof(x)39end subroutine40