2010-11-11 Jakub Jelinek <jakub@redhat.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / char_expr_3.f90
blobfed0f3c78bc6448af652be4d4f9e91daaa14f2c6
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)
5 ! Conributed by Vivek Rao <vivekrao4@yahoo.com>
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