OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [proc_ptr_28.f90] - Rev 694

Compare with Previous | Blame | View Log

! { dg-do compile }
!
! PR 44718: Procedure-pointer name is wrongly regarded as "external procedure"
!
! Contributed by John McFarland <john.mcfarland@swri.org>

MODULE m

 IMPLICIT NONE

CONTAINS

 FUNCTION func(x) RESULT(y)
   INTEGER :: x,y
   y = x *2
 END FUNCTION func

 SUBROUTINE sub(x)
   INTEGER :: x
   PRINT*, x
 END SUBROUTINE sub


 SUBROUTINE use_func()
   PROCEDURE(func), POINTER :: f
   INTEGER :: y
   f => func
   y = f(2)
 END SUBROUTINE use_func

 SUBROUTINE use_sub()
   PROCEDURE(sub), POINTER :: f
   f => sub
   CALL f(2)
 END SUBROUTINE use_sub

END MODULE m 

! { 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.