| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! Test fix for PR80945, in which the character length was fixed at zero. |
| 4 |
! |
| 5 |
! Contributed by Nicolas Koenig <[email protected]> |
| 6 |
! |
| 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 |