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])) call abort ()
18 if (any (ubound(ptr
) /= [ 1, 3])) call abort ()
19 if (any (shape(ptr
) /= [ 1, 3])) call abort ()
20 if (any (ptr(1,:) /= array
)) call abort()
22 call c_f_pointer(x
, ptr2
, shape
=myshape([1,3,1]))
23 if (any (lbound(ptr2
) /= [ 1, 1, 1])) call abort ()
24 if (any (ubound(ptr2
) /= [ 1, 3, 1])) call abort ()
25 if (any (shape(ptr2
) /= [ 1, 3, 1])) call abort ()
26 if (any (ptr2(1,:,1) /= array
)) call abort()