OSDN Git Service

2010-02-10 Joost VandeVondele <jv244@cam.ac.uk>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / char_expr_3.f90
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 !
7 program 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
17 contains
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
25 end program main
26