3 ! Test the fix for PR94331
5 ! Contributed by Robin Hogan <r.j.hogan@reading.ac.uk>
10 use, intrinsic :: iso_c_binding
, only
: &
16 integer, parameter :: n
= 11
17 real(kind
=c_float
), parameter :: u(*) = [(real(i
, kind
=c_float
), i
=1,n
)]
19 real(kind
=c_float
), allocatable
:: A(:)
20 real(kind
=c_float
) :: E(n
)
21 integer(kind
=c_int
) :: l1
, l2
, l3
25 call routine_bindc(A
, l2
) ! in gcc-9.2.1 this changes lbound of A...
30 if (any(abs(A(1:n
)-u
)>0.0_c_float
)) stop 4
35 call routine_bindc(E
, l2
) ! ...but does not change lbound of E
40 if (any(abs(E(1:n
)-u
)>0.0_c_float
)) stop 8
44 subroutine routine_bindc(v
, l
) bind(c
)
45 real(kind
=c_float
), intent(inout
) :: v(:)
46 integer(kind
=c_int
), intent(out
) :: l
49 if (any(abs(v(1:n
)-u
)>0.0_c_float
)) stop 9
50 end subroutine routine_bindc