[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / call22.f90
blobe418b98964cd2474f0486b8e153d6f956dacca1c
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Enforce array conformance across actual arguments to ELEMENTAL
3 module m
4 contains
5 real elemental function f(a, b)
6 real, intent(in) :: a, b
7 f = a + b
8 end function
9 real function g(n)
10 integer, value :: n
11 g = sqrt(real(n))
12 end function
13 subroutine test
14 real :: a(3) = [1, 2, 3]
15 !ERROR: Dimension 1 of actual argument (a) corresponding to dummy argument #1 ('a') has extent 3, but actual argument ([REAL(4)::(g(int(j,kind=4)),INTEGER(8)::j=1_8,2_8,1_8)]) corresponding to dummy argument #2 ('b') has extent 2
16 print *, f(a, [(g(j), j=1, 2)])
17 end subroutine
18 end