2 module c_funloc_tests_2
3 use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
7 recursive subroutine sub0() bind(c)
8 type(c_funptr) :: my_c_funptr
9 integer :: my_local_variable
11 my_c_funptr = c_funloc() ! { dg-error "Missing actual argument 'x' in call to 'c_funloc'" }
12 my_c_funptr = c_funloc(sub0)
13 my_c_funptr = c_funloc(sub0, sub0) ! { dg-error "Too many arguments in call to 'c_funloc'" }
14 my_c_funptr = c_funloc(my_local_variable) ! { dg-error "Argument X at .1. to C_FUNLOC shall be a procedure or a procedure pointer" }
16 end module c_funloc_tests_2