3 ! Check that PR50221 comment #4 is fixed.
5 ! Contributed by Arjen Makus <arjen.markus895@gmail.com>
7 program chk_alloc_string
10 character(len
=:), dimension(:), allocatable
:: strings
11 character(20) :: buffer
14 allocate( character(10):: strings(1:3) )
16 strings
= [ "A ", "C ", "ABCD", "V " ]
18 if (len(strings
) .ne
. 4) call abort
19 if (size(strings
, 1) .ne
. 4) call abort
20 if (any (strings
.ne
. [character(len
=4) :: "A", "C", "ABCD", "V"])) call abort
22 strings
= [character(len
=4) :: "A", "C", "ABCDE", "V", "zzzz"]
24 if (len(strings
) .ne
. 4) call abort
25 if (size(strings
, 1) .ne
. 5) call abort
26 if (any (strings
.ne
. [character(len
=4) :: "A", "C", "ABCD", "V", "zzzz"])) call abort
28 write (buffer
, "(5a4)") strings
29 if (buffer
.ne
. "A C ABCDV zzzz") call abort
30 end program chk_alloc_string