2 ! { dg-additional-sources proc_ptr_8.c }
7 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
13 INTEGER(KIND
=C_INT
) FUNCTION mytype( a
) BIND(C
)
15 INTEGER(KIND
=C_INT
), VALUE
:: a
17 SUBROUTINE init() BIND(C
,name
="init")
21 TYPE(C_FUNPTR
), BIND(C
,name
="funpointer") :: funpointer
26 PROCEDURE(mytype
), POINTER :: ptype
,ptype2
29 CALL C_F_PROCPOINTER(funpointer
,ptype
)
30 if (ptype(3) /= 9) call abort()
32 ! the stuff below was added with PR 42072
33 call setpointer(ptype2
)
34 if (ptype2(4) /= 12) call abort()
38 subroutine setpointer (p
)
39 PROCEDURE(mytype
), POINTER :: p
40 CALL C_F_PROCPOINTER(funpointer
,p
)