2018-02-18 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / deferred_character_19.f90
blob96722a144f6aeb3564635a5cd4533ea3545d5cfb
1 ! { dg-do run }
3 ! Test fix for PR80945, in which the character length was fixed at zero.
5 ! Contributed by Nicolas Koenig <koenigni@gcc.gnu.org>
7 program main
8 implicit none
9 integer:: i
10 integer, parameter:: N = 10
11 character(20) :: buffer
12 character(len=:), dimension(:),allocatable:: ca
13 character(len=:), dimension(:,:),allocatable:: cb
14 allocate(character(len=N) :: ca(3))
15 ca(1) = "foo"
16 ca(2) = "bar"
17 ca(3) = "xyzzy"
18 write (buffer, '(3A5)') ca(1:3)
19 if (trim (buffer) .ne. "foo bar xyzzy") stop 1
20 end program