2 ! { dg-options "-std=f2003" }
5 use, intrinsic :: iso_c_binding
9 subroutine sub0() bind(c)
10 integer(c_int), target, dimension(10) :: my_array
11 integer(c_int), pointer, dimension(:) :: my_array_ptr
12 type(c_ptr) :: my_c_ptr
14 my_array_ptr => my_array
15 my_c_ptr = c_loc(my_array_ptr) ! { dg-error "Fortran 2008: Array of interoperable type at .1. to C_LOC which is nonallocatable and neither assumed size nor explicit size" }
17 end module c_loc_tests_4