aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/c_loc_test_21.f90
blob: a31ca034fbb7af6d7c9829a1fc29e7c071753610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
! { dg-do compile }
! { dg-options "-std=f2003" }

subroutine foo(a,b,c,d)
   use iso_c_binding, only: c_loc, c_ptr
   implicit none
   real, intent(in), target :: a(:)
   real, intent(in), target :: b(5)
   real, intent(in), target :: c(*)
   real, intent(in), target, allocatable :: d(:)
   type(c_ptr) :: ptr
   ptr = C_LOC(b)
   ptr = C_LOC(c)
   ptr = C_LOC(d)
   ptr = C_LOC(a) ! { dg-error "Fortran 2008: Array of interoperable type at .1. to C_LOC which is nonallocatable and neither assumed size nor explicit size" }
end subroutine foo