9 use, intrinsic :: iso_c_binding
14 real, allocatable
:: array2(:,:)
17 type(obj
), target
:: obj1
20 real, pointer :: array(:)
22 allocate (obj1
%array2(10,10))
23 obj1
%array
= reshape ([(i
, i
=1,100)], shape (obj1
%array
))
24 obj1
%array2
= reshape ([(i
, i
=1,100)], shape (obj1
%array
))
26 cptr
= c_loc (obj1
%array
)
27 call c_f_pointer (cptr
, array
, shape
=[100])
28 if (any (array
/= [(i
, i
=1,100)])) STOP 1
30 cptr
= c_loc (obj1
%array2
)
31 call c_f_pointer (cptr
, array
, shape
=[100])
32 if (any (array
/= [(i
, i
=1,100)])) STOP 2