1! { dg-do run } 2program main 3 use iso_c_binding, only: c_ptr, c_loc, c_f_pointer 4 implicit none 5 integer, dimension(2,1,2), target :: table 6 table = reshape ( (/ 1,2,-1,-2/), (/2,1,2/)) 7 call set_table (c_loc (table)) 8contains 9 subroutine set_table (cptr) 10 type(c_ptr), intent(in) :: cptr 11 integer, dimension(:,:,:), pointer :: table_tmp 12 call c_f_pointer (cptr, table_tmp, (/2,1,2/)) 13 if (any(table_tmp /= table)) call abort 14 end subroutine set_table 15end program main 16