6 ! Run-time checks for IS_CONTIGUOUS
9 integer, pointer :: a(:), b(:,:)
12 allocate(a(5), b(10,10))
15 if (.true
. .neqv
. is_contiguous (a(::s
))) stop 1
17 if (.false
. .neqv
. is_contiguous (a(::s
))) stop 2
19 if (.true
. .neqv
. is_contiguous (b(1:i
*2,1:j
))) stop 3
20 if (.false
. .neqv
. is_contiguous (b(1:i
,1:j
))) stop 4
22 if (.false
. .neqv
. is_contiguous (b(i
:5:s
,i
:j
*2))) stop 5
24 ! The following test zero-sized arrays. For the standard, they
25 ! are regarded as noncontiguous. However, gfortran in line with
26 ! other compilers only checks for the strides and thus prints
27 ! .true. or .false. depending on this setting.
30 if (.false
. .neqv
. is_contiguous (a(2:1:s
))) stop 6
32 if (.true
. .neqv
. is_contiguous (a(2:1:s
))) stop 7