2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / c_loc_tests_4.f03
blobd45a89156fc79ec838f848c9ab8274f33e9e74c7
1 ! { dg-do compile }
2 ! { dg-options "-std=f2003" }
4 module c_loc_tests_4
5   use, intrinsic :: iso_c_binding
6   implicit none
8 contains
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" }
16   end subroutine sub0
17 end module c_loc_tests_4