2 ! Test the fix for pr22146, where and elemental subroutine with
3 ! array actual arguments would cause an ICE in gfc_conv_function_call.
4 ! The module is the original test case and the rest is a basic
5 ! functional test of the scalarization of the function call.
7 ! Contributed by Erik Edelmann <erik.edelmann@iki.fi>
8 ! and Paul Thomas <pault@gcc.gnu.org>
14 elemental subroutine foo(a)
15 integer, intent(out) :: a
27 real, dimension (2) :: x, y
34 ! Check the various combinations of scalar and array.
36 if (any(y.ne.-x)) call abort ()
39 if (any(y.ne.-42.0)) call abort ()
42 if (v.ne.-42.0) call abort ()
46 if (any(x /= -2.0)) call abort ()
48 ! Test an expression in the INTENT(IN) argument
50 call foobar (cos (x) + u, y)
51 if (any(abs (y + cos (x) + u) .gt. 2.0e-6)) call abort ()
55 elemental subroutine foobar (a, b)
57 real, intent(out) :: b
62 ! { dg-final { cleanup-modules "pr22146" } }