1 ! Like array_alloc_1.f90, but check cases in which the array length is
2 ! not a literal constant.
6 integer, parameter :: n
= 100
8 call test (47, f2 (50))
9 call test (n
, f3 (f1 ()))
11 subroutine test (expected
, x
)
12 integer, dimension (:) :: x
13 integer :: i
, expected
14 if (size (x
, 1) .ne
. expected
) call abort
16 if (x (i
) .ne
. i
* 100) call abort
21 integer, dimension (n
) :: f1
23 forall (i
= 1:n
) f1 (i
) = i
* 100
28 integer, dimension (4:howmuch
) :: f2
29 forall (i
= 4:howmuch
) f2 (i
) = i
* 100 - 300
33 integer, dimension (:) :: x
34 integer, dimension (size (x
, 1)) :: f3
36 forall (i
= 1:size(x
)) f3 (i
) = i
* 100