3 ! Check that C_F_Pointer works with a noncontiguous SHAPE argument
7 integer, target
:: array(3)
8 integer, pointer :: ptr(:,:)
9 integer, pointer :: ptr2(:,:,:)
16 call c_f_pointer(x
, ptr
, shape
=myshape(1:4:2))
17 if (any (lbound(ptr
) /= [ 1, 1])) STOP 1
18 if (any (ubound(ptr
) /= [ 1, 3])) STOP 2
19 if (any (shape(ptr
) /= [ 1, 3])) STOP 3
20 if (any (ptr(1,:) /= array
)) STOP 4
22 call c_f_pointer(x
, ptr2
, shape
=myshape([1,3,1]))
23 if (any (lbound(ptr2
) /= [ 1, 1, 1])) STOP 5
24 if (any (ubound(ptr2
) /= [ 1, 3, 1])) STOP 6
25 if (any (shape(ptr2
) /= [ 1, 3, 1])) STOP 7
26 if (any (ptr2(1,:,1) /= array
)) STOP 8