xref: /llvm-project/flang/test/Evaluate/elem-shape.f90 (revision 71d5a94985c9569467c1ef8a62b8b326ee2036a6)
1! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s
2! Ensure that optional arguments aren't used to fold SIZE() or SHAPE()
3module m
4 contains
5  subroutine sub(x,y)
6    real :: x(:), y(:)
7    optional x
8    !CHECK: PRINT *, int(size(y,dim=1,kind=8),kind=4)
9    print *, size(f(x,y))
10  end
11  elemental function f(x,y)
12    real, intent(in) :: x, y
13    optional x
14    f = y
15  end
16end
17