2 ! { dg-options "-std=f2003" }
3 ! Test that the arg checking for c_funloc verifies the procedures are
5 module c_funloc_tests_5
6 use, intrinsic :: iso_c_binding, only: c_funloc, c_funptr
8 subroutine sub0() bind(c)
9 type(c_funptr) :: my_c_funptr
11 my_c_funptr = c_funloc(sub1) ! { dg-error "TS 29113/TS 18508: Noninteroperable procedure at .1. to C_FUNLOC" }
13 my_c_funptr = c_funloc(func0) ! { dg-error "TS 29113/TS 18508: Noninteroperable procedure at .1. to C_FUNLOC" }
19 function func0(desired_retval)
20 use, intrinsic :: iso_c_binding, only: c_int
21 integer(c_int), value :: desired_retval
22 integer(c_int) :: func0
23 func0 = desired_retval
25 end module c_funloc_tests_5