Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / c_loc_test_21.f90
bloba31ca034fbb7af6d7c9829a1fc29e7c071753610
1 ! { dg-do compile }
2 ! { dg-options "-std=f2003" }
4 subroutine foo(a,b,c,d)
5 use iso_c_binding, only: c_loc, c_ptr
6 implicit none
7 real, intent(in), target :: a(:)
8 real, intent(in), target :: b(5)
9 real, intent(in), target :: c(*)
10 real, intent(in), target, allocatable :: d(:)
11 type(c_ptr) :: ptr
12 ptr = C_LOC(b)
13 ptr = C_LOC(c)
14 ptr = C_LOC(d)
15 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" }
16 end subroutine foo