1 ! Program to test assumed size arrays
3 integer, dimension(2, *) :: p
5 if (any (p(:, 1:3) .ne
. reshape((/1, 2, 4, 5, 7, 8/), (/2, 3/)))) &
10 integer, dimension (3, 3) :: a
13 a
= reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))
15 call test1(a
, (/1, 2, 3, 4, 5, 6/))
16 if (a(1,1) .ne
. 0) call abort
18 call test1(a(1:2, :), (/1, 2, 4, 5, 7, 8/))
19 if (a(1,1) .ne
. 0) call abort
21 call test1(a(3:1:-1, :), (/3, 2, 1, 6, 5, 4/))
22 if (a(3,1) .ne
. 0) call abort
24 call test1(a(:, 2:3), (/4, 5, 6, 7, 8, 9/))
25 if (a(1, 2) .ne
. 0) call abort
29 call test2((/1, 2, 4, 5, 7, 8/))
31 subroutine test1(p
, q
)
32 integer, dimension(*) :: p
33 integer, dimension(1:) :: q
35 if (any (p(1:size(q
)) .ne
. q
)) call abort ()