Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / repack_arrays_1.f90
blobf1d6bbc10481ef51c60ff6919c37cba1cd6ebc5e
1 ! { dg-do run }
2 ! { dg-options "-frepack-arrays" }
4 ! Check that arrays marked with TARGET attribute are not repacked.
6 program test2
7 use iso_c_binding
8 implicit none
9 real, target :: x(7)
10 type(c_ptr) cp1, cp2
12 x = 42
13 if (.not. c_associated(c_loc(x(3)),point(x(::2)))) STOP 1
14 contains
15 function point(x)
16 use iso_c_binding
17 real, intent(in), target :: x(:)
18 type(c_ptr) point
19 real, pointer :: p
21 p => x(2)
22 point = c_loc(p)
23 end function point
24 end program test2