! { dg-do run }
!
! Used to segfault at the write statement.
!
! Contributed by Gerhard Steinmetz  <gscfq@t-online.de>
!
  character(20) :: buffer
  call s([" g'day "," bye!! "])
  print *, buffer
  if (trim (buffer) .ne. " a g'day a bye!!") stop 1
contains
  subroutine s(x)
    character(*) :: x(:)
    associate (y => 'a'//x)
      write (buffer, *) y
    end associate
  end
end