2 ! { dg-options "-std=legacy" }
4 ! Program to test character array constructors.
6 subroutine test1 (n
, t
, u
)
8 character(len
=n
) :: s(2)
12 ! A variable array constructor.
14 ! An array constructor as part of an expression.
15 if (any (s
.ne
. (/"Hell", "Worl"/))) call abort
21 ! A constant array constructor
22 s
= (/"Hello", "World"/)
23 if ((s(1) .ne
. "Hello") .or
. (s(2) .ne
. "World")) call abort
31 ! A large array constructor
32 s
= (/'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', &
33 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'/)
38 ! Assignment with dependency
39 s
= (/(s(27-i
), i
=1, 26)/)
43 if (t
.ne
. "zyxwvutsrqponmlkjihgfedcba") call abort
47 call test1 (4, "Hello", "World")