1 ! Program to test array constructors
3 integer, dimension (4) :: a
4 integer, dimension (3, 2) :: b
5 integer i
, j
, k
, l
, m
, n
9 if (a(i
) .ne
. i
) call abort
12 b
= reshape ((/0, 1, 2, 3, 4, 5/), (/3, 2/)) + 1
14 if (b(i
, 1) .ne
. i
) call abort
15 if (b(i
, 2) .ne
. i
+ 3) call abort
22 ! The remainder assumes constant constructors work ok.
24 if (any (a
.ne
. (/4, 3, 2, 1/))) call abort
25 a
= (/((/i
+10, 42/), i
= k
, l
)/)
26 if (any (a
.ne
. (/11, 42, 12, 42/))) call abort
27 a
= (/(I
, I
=k
,l
) , (J
, J
=m
,n
)/)
28 if (any (a
.ne
. (/1, 2, 3, 4/))) call abort