2 ! PR fortran/114001 - IS_CONTIGUOUS and polymorphic dummy
8 integer, target
:: m(10) = [(i
,i
=1,size(m
))]
9 integer, pointer :: p(:)
13 type(t
), pointer :: tt(:), tp(:) ! Type pointer
14 class(t
), pointer :: ct(:), cp(:) ! Class pointer
17 expect
= is_contiguous (p
)
18 print *, "is_contiguous (p)=", expect
19 if (.not
. expect
) stop 91
20 call sub_star (p
, expect
)
22 expect
= is_contiguous (p
)
23 print *, "is_contiguous (p)=", expect
25 call sub_star (p
, expect
)
30 expect
= is_contiguous (tp
)
31 if (.not
. expect
) stop 96
32 print *, "is_contiguous (tp)=", expect
33 call sub_t (tp
, expect
)
35 expect
= is_contiguous (tp
)
37 print *, "is_contiguous (tp)=", expect
38 call sub_t (tp
, expect
)
43 expect
= is_contiguous (cp
)
44 print *, "is_contiguous (cp)=", expect
45 if (.not
. expect
) stop 98
46 call sub_t (cp
, expect
)
48 expect
= is_contiguous (cp
)
49 print *, "is_contiguous (cp)=", expect
51 call sub_t (cp
, expect
)
55 subroutine sub_star (x
, expect
)
56 class(*), intent(in
) :: x(:)
57 logical, intent(in
) :: expect
59 if (is_contiguous (x
) .neqv
. expect
) then
60 print *, "sub_star(1): is_contiguous (x)=", is_contiguous (x
), expect
65 if (is_contiguous (x
) .neqv
. expect
) then
66 print *, "sub_star(2): is_contiguous (x)=", is_contiguous (x
), expect
72 subroutine sub_t (x
, expect
)
73 class(t
), intent(in
) :: x(:)
74 logical, intent(in
) :: expect
76 if (is_contiguous (x
) .neqv
. expect
) then
77 print *, "sub_t: is_contiguous (x)=", is_contiguous (x
), expect