2 ! { dg-additional-sources c_funloc_tests_3_funcs.c }
3 ! This testcase tests c_funloc and c_funptr from iso_c_binding. It uses
4 ! functions defined in c_funloc_tests_3_funcs.c.
5 module c_funloc_tests_3
8 function ffunc(j) bind(c)
9 use iso_c_binding, only: c_funptr, c_int
10 integer(c_int) :: ffunc
11 integer(c_int), value :: j
14 end module c_funloc_tests_3
16 use iso_c_binding, only: c_funptr, c_funloc
17 use c_funloc_tests_3, only: ffunc
20 function returnFunc() bind(c,name="returnFunc")
21 use iso_c_binding, only: c_funptr
22 type(c_funptr) :: returnFunc
23 end function returnFunc
24 subroutine callFunc(func,pass,compare) bind(c,name="callFunc")
25 use iso_c_binding, only: c_funptr, c_int
26 type(c_funptr), value :: func
27 integer(c_int), value :: pass,compare
28 end subroutine callFunc
32 call callFunc(p, 13,3*13)
34 call callFunc(p, 21,-17*21)
36 ! { dg-final { cleanup-modules "c_funloc_tests_3" } }