23 lines · plain
1! Check that stack save and restore needed for elemental function result2! allocation inside loops are not emitted directly in lowering, but inserted if3! needed in the stack-reclaim pass.4 5! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefix=CHECK-HLFIR6! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-LLVM7subroutine foo(c1, c2)8 character(*), dimension(100) :: c1, c29 interface10 elemental pure function func(c)11 character(*), intent(in) :: c12 character(len(c)) :: func13 end function14 end interface15 c1 = func(c2)16end subroutine17 18! CHECK-HLFIR-NOT: stacksave19! CHECK: return20 21! CHECK-LLVM: stacksave22! CHECK-LLVM: stackrestore23