3 ! Testcases from PR32002.
7 CALL test_1() ! scalar/vector
8 CALL test_2() ! vector/vector
9 CALL test_3() ! matrix/vector
10 CALL test_4() ! matrix/matrix
13 ELEMENTAL
FUNCTION f(x
)
14 INTEGER, INTENT(in
) :: x
20 INTEGER :: a
= 0, b(2) = 0
21 a
= f(b
) ! { dg-error "Incompatible ranks" }
22 b
= f(a
) ! ok, set all array elements to f(a)
26 INTEGER :: a(2) = 0, b(3) = 0
27 a
= f(b
) ! { dg-error "Different shape" }
28 a
= f(b(1:2)) ! ok, slice, stride 1
29 a
= f(b(1:3:2)) ! ok, slice, stride 2
33 INTEGER :: a(4) = 0, b(2,2) = 0
34 a
= f(b
) ! { dg-error "Incompatible ranks" }
35 a
= f(RESHAPE(b
, (/ 4 /))) ! ok, same shape
39 INTEGER :: a(2,2) = 0, b(3,3) = 0
40 a
= f(b
) ! { dg-error "Different shape" }
41 a
= f(b(1:3, 1:2)) ! { dg-error "Different shape" }
42 a
= f(b(1:3:2, 1:3:2)) ! ok, same shape