1 ! { dg-do run { target c99_runtime } }
2 ! { dg-additional-sources ISO_Fortran_binding_10.c }
4 ! Test the fix of PR89843.
6 ! Contributed by Reinhold Bader <Bader@lrz.de>
9 use, intrinsic :: iso_c_binding
12 subroutine si(this
, flag
, status
) bind(c
)
13 import
:: c_float
, c_int
14 real(c_float
) :: this(:,:)
15 integer(c_int
), value
:: flag
16 integer(c_int
) :: status
20 subroutine sa(this
, flag
, status
) bind(c
)
21 real(c_float
) :: this(:)
22 integer(c_int
), value
:: flag
23 integer(c_int
) :: status
29 if (is_contiguous(this
)) then
33 if (size(this
,1) /= 3) then
34 write(*,*) 'FAIL 2:',size(this
)
38 if (maxval(abs(this
- [ 1.0, 3.0, 5.0 ])) > 1.0e-6) then
39 write(*,*) 'FAIL 3:',abs(this
)
44 if (size(this
,1) /= 3) then
45 write(*,*) 'FAIL 4:',size(this
)
49 if (maxval(abs(this
- [ 11.0, 12.0, 13.0 ])) > 1.0e-6) then
50 write(*,*) 'FAIL 5:',this
55 if (size(this
,1) /= 4) then
56 write(*,*) 'FAIL 6:',size(this
)
60 if (maxval(abs(this
- [ 2.0, 7.0, 12.0, 17.0 ])) > 1.0e-6) then
61 write(*,*) 'FAIL 7:',this
67 ! if (status == 0) then
71 end module mod_section_01
76 real(c_float
) :: v(5,4)
80 v
= reshape( [ (real(i
), i
= 1, 20) ], [ 5, 4 ] )
82 if (status
.ne
. 0) stop 1
84 call sa(v(1:5:2, 1), 0, status
)
85 if (status
.ne
. 0) stop 2
88 if (status
.ne
. 0) stop 3
90 call sa(v(1:3, 3), 1, status
)
91 if (status
.ne
. 0) stop 4
94 if (status
.ne
. 0) stop 5
96 call sa(v(2,1:4), 2, status
)
97 if (status
.ne
. 0) stop 6
99 end program section_01