URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 302 |
Rev 384 |
! { dg-do compile }
|
! { dg-do compile }
|
!
|
!
|
! PR 40039: Procedures as actual arguments: Check intent of arguments
|
! PR 40039: Procedures as actual arguments: Check intent of arguments
|
!
|
!
|
! Contributed by Janus Weil
|
! Contributed by Janus Weil
|
|
|
module m
|
module m
|
|
|
contains
|
contains
|
|
|
subroutine a(x,f)
|
subroutine a(x,f)
|
real :: x
|
real :: x
|
interface
|
interface
|
real function f(y)
|
real function f(y)
|
real,intent(in) :: y
|
real,intent(in) :: y
|
end function
|
end function
|
end interface
|
end interface
|
print *,f(x)
|
print *,f(x)
|
end subroutine
|
end subroutine
|
|
|
real function func(z)
|
real function func(z)
|
real,intent(inout) :: z
|
real,intent(inout) :: z
|
func = z**2
|
func = z**2
|
end function
|
end function
|
|
|
subroutine caller
|
subroutine caller
|
interface
|
interface
|
real function p(y)
|
real function p(y)
|
real,intent(in) :: y
|
real,intent(in) :: y
|
end function
|
end function
|
end interface
|
end interface
|
pointer :: p
|
pointer :: p
|
|
|
call a(4.3,func) ! { dg-error "INTENT mismatch in argument" }
|
call a(4.3,func) ! { dg-error "INTENT mismatch in argument" }
|
p => func ! { dg-error "INTENT mismatch in argument" }
|
p => func ! { dg-error "INTENT mismatch in argument" }
|
end subroutine
|
end subroutine
|
|
|
end module
|
end module
|
|
|
! { dg-final { cleanup-modules "m" } }
|
! { dg-final { cleanup-modules "m" } }
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.