1214571Sdim! { dg-do run }
2214571Sdim! Check the fix for PR36795, where the parentheses in the call to foo were
3214571Sdim! simplified out ie. foo((xx), xx) simplified to foo (xx, xx)
4214571Sdim!
5214571Sdim! Conributed by Vivek Rao <vivekrao4@yahoo.com>
6214571Sdim!
7214571Sdimprogram main
8214571Sdim  implicit none
9214571Sdim  character(len=10), allocatable :: xx(:)
10214571Sdim  character(len=10)              :: yy
11214571Sdim  allocate (xx(2))
12214571Sdim  xx(1)      = ""
13214571Sdim  xx(2)      = "dog"
14214571Sdim  call foo ((xx),xx)
15214571Sdim  if (trim (xx(1)) .ne. "dog") call abort
16214571Sdim  if (size (xx, 1) .ne. 1) call abort
17214571Sdimcontains
18214571Sdim  subroutine foo (xx,yy)
19214571Sdim  character(len=*), intent(in)               :: xx(:)
20214571Sdim  character(len=*), intent(out), allocatable :: yy(:)
21214571Sdim  if (allocated (yy)) deallocate (yy)
22214571Sdim  allocate (yy(1))
23214571Sdim  yy = xx(2)
24214571Sdim  end subroutine foo
25214571Sdimend program main
26214571Sdim
27214571Sdim