2 ! { dg-options "-fcheck=all" }
6 ! Contributed by T Kondic
10 integer, parameter :: pa
=10, pb
=20
11 complex, target
:: a(pa
*pb
)
12 real, pointer:: ptr(:,:) =>null()
20 ! Was ICEing before with bounds checks
21 ptr(1:pa
*2,1:pb
) => conv2real(a
)
25 do i
= 1, ubound(ptr
,dim
=2)
26 do j
= 1, ubound(ptr
,dim
=1)
28 if (-cnt
/= ptr(j
, i
)) call abort()
32 if (cnt
/= ptr(j
, i
)) call abort()
39 function conv2real(carr
)
40 use, intrinsic :: iso_c_binding
41 ! returns real pointer to a complex array
42 complex, contiguous
, intent(inout
), target
:: carr(:)
43 real,contiguous
,pointer :: conv2real(:)
44 call c_f_pointer(c_loc(carr
),conv2real
,[size(carr
)*2])
45 end function conv2real