3 ! PR 38290: Procedure pointer assignment checking.
5 ! Test case found at http://de.wikibooks.org/wiki/Fortran:_Fortran_2003:_Zeiger
6 ! Adapted by Janus Weil <janus@gcc.gnu.org>
10 intrinsic :: isign
, iabs
14 ! As intrinsics but not elemental
15 pure
integer function isign_interf(a
, b
)
16 integer, intent(in
) :: a
, b
17 end function isign_interf
18 pure
integer function iabs_interf(x
)
19 integer, intent(in
) :: x
20 end function iabs_interf
23 procedure( up
) , pointer :: pptr
24 procedure(isign_interf
), pointer :: q
26 procedure(iabs_interf
),pointer :: p1
27 procedure(f
), pointer :: p2
37 pptr
=> add
! { dg-error "is not a subroutine" }
41 print *, pptr() ! { dg-error "is not a function" }
50 p1
=> abs
! { dg-error "Type mismatch in function result" }
51 p2
=> abs
! { dg-error "Type mismatch in function result" }
54 p3
=> sin
! { dg-error "Type mismatch in function result" }
58 pure
function add( a
, b
)
60 integer, intent( in
) :: a
, b
64 pure
integer function f(x
)
65 integer,intent(in
) :: x