1! { dg-do run }
2! Test fix of PR28118, in which a substring reference to an
3! actual argument with an array reference would cause a segfault.
4!
5! Contributed by Paul Thomas  <pault@gcc.gnu.org>
6!
7program gfcbug33
8  character(12) :: a(2)
9  a(1) = "abcdefghijkl"
10  a(2) = "mnopqrstuvwx"
11  call foo ((a(2:1:-1)(6:)))
12  call bar ((a(:)(7:11)))
13contains
14  subroutine foo (chr)
15    character(7) :: chr(:)
16    if (chr(1)//chr(2) .ne. "rstuvwxfghijkl") call abort ()
17  end subroutine foo
18  subroutine bar (chr)
19    character(*) :: chr(:)
20    if (trim(chr(1))//trim(chr(2)) .ne. "ghijkstuvw") call abort ()
21  end subroutine bar
22end program gfcbug33
23