1! { dg-do run } 2! 3! Check that PR50221 comment #4 is fixed. 4! 5! Contributed by Arjen Makus <arjen.markus895@gmail.com> 6! 7program chk_alloc_string 8 implicit none 9 10 character(len=:), dimension(:), allocatable :: strings 11 character(20) :: buffer 12 integer :: i 13 14 allocate( character(10):: strings(1:3) ) 15 16 strings = [ "A ", "C ", "ABCD", "V " ] 17 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 21 22 strings = [character(len=4) :: "A", "C", "ABCDE", "V", "zzzz"] 23 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 27 28 write (buffer, "(5a4)") strings 29 if (buffer .ne. "A C ABCDV zzzz") call abort 30end program chk_alloc_string 31