Files
clang-p2996/flang/test/Lower/shape-of-elemental-with-optional-arg.f90
Slava Zakharin fb7366cab1 [flang] Fixed shape computation for elementals with optional dummys.
It looks like a regression after D151737: shape of the elemental
call became rank-0.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D156386
2023-07-27 13:56:13 -07:00

20 lines
591 B
Fortran

! Test that the shape of the elemental call is properly
! computed as being rank 1, even though the only dummy
! argument is optional.
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc -emit-hlfir %s -o - | FileCheck %s
subroutine test
interface
elemental function callee(arg1)
integer, intent(in), optional :: arg1
integer :: fun
end function callee
end interface
integer :: arr(2)
print *, callee(arr)
end subroutine test
! The PRINT statement must be lowered into a ranked print:
! CHECK: fir.call @_FortranAioOutputDescriptor