summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/proc_ptr_13.f90
blob: 5c66c54e9dbdd48893de6b73feeb8d06cd17e908 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
! { dg-do compile }
! { dg-options "-g" }
!
! PR 38152: Procedure pointers as module variables.
!
! Contributed by Daniel Kraft <domob@gcc.gnu.org>

MODULE myfortran_binding

  IMPLICIT NONE
  PROCEDURE(error_stop), POINTER :: error_handler

CONTAINS

  LOGICAL FUNCTION myfortran_shutdown ()
    CALL error_handler ()
  END FUNCTION myfortran_shutdown

  SUBROUTINE error_stop ()
  END SUBROUTINE error_stop

END MODULE myfortran_binding


use myfortran_binding
error_handler => error_stop
end

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