OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [interface_27.f90] - Rev 384

Compare with Previous | Blame | View Log

! { dg-do compile }
!
! PR 40039: Procedures as actual arguments: Check intent of arguments
!
! Contributed by Janus Weil <janus@gcc.gnu.org>

module m

contains

subroutine a(x,f)
  real :: x
  interface
    real function f(y)
      real,intent(in) :: y
    end function
  end interface
  print *,f(x)
end subroutine

real function func(z)
  real,intent(inout) :: z
  func = z**2
end function

subroutine caller
  interface
    real function p(y)
      real,intent(in) :: y
    end function
  end interface
  pointer :: p

  call a(4.3,func)  ! { dg-error "INTENT mismatch in argument" }
  p => func         ! { dg-error "INTENT mismatch in argument" }
end subroutine

end module 

! { dg-final { cleanup-modules "m" } }

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.