URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [elemental_subroutine_1.f90] - Rev 302
Compare with Previous | Blame | View Log
! { dg-do run }! Test the fix for pr22146, where and elemental subroutine with! array actual arguments would cause an ICE in gfc_conv_function_call.! The module is the original test case and the rest is a basic! functional test of the scalarization of the function call.!! Contributed by Erik Edelmann <erik.edelmann@iki.fi>! and Paul Thomas <pault@gcc.gnu.org>module pr22146containselemental subroutine foo(a)integer, intent(out) :: aa = 0end subroutine foosubroutine bar()integer :: a(10)call foo(a)end subroutine barend module pr22146use pr22146real, dimension (2) :: x, yreal :: u, vx = (/1.0, 2.0/)u = 42.0call bar ()! Check the various combinations of scalar and array.call foobar (x, y)if (any(y.ne.-x)) call abort ()call foobar (u, y)if (any(y.ne.-42.0)) call abort ()call foobar (u, v)if (v.ne.-42.0) call abort ()v = 2.0call foobar (v, x)if (any(x /= -2.0)) call abort ()! Test an expression in the INTENT(IN) argumentx = (/1.0, 2.0/)call foobar (cos (x) + u, y)if (any(abs (y + cos (x) + u) .gt. 4.0e-6)) call abort ()containselemental subroutine foobar (a, b)real, intent(IN) :: areal, intent(out) :: bb = -aend subroutine foobarend! { dg-final { cleanup-modules "pr22146" } }
