1! { dg-do run }
2! Check the fix for PR36795, where the parentheses in the call to foo were
3! simplified out ie. foo((xx), xx) simplified to foo (xx, xx)
4!
5! Conributed by Vivek Rao <vivekrao4@yahoo.com>
6!
7program main
8  implicit none
9  character(len=10), allocatable :: xx(:)
10  character(len=10)              :: yy
11  allocate (xx(2))
12  xx(1)      = ""
13  xx(2)      = "dog"
14  call foo ((xx),xx)
15  if (trim (xx(1)) .ne. "dog") call abort
16  if (size (xx, 1) .ne. 1) call abort
17contains
18  subroutine foo (xx,yy)
19  character(len=*), intent(in)               :: xx(:)
20  character(len=*), intent(out), allocatable :: yy(:)
21  if (allocated (yy)) deallocate (yy)
22  allocate (yy(1))
23  yy = xx(2)
24  end subroutine foo
25end program main
26
27