PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / char_expr_1.f90
blob0b5e4bd26a95f447a64dc24d5b1b802d1d0b6883
1 ! { dg-do run }
2 ! PR fortran/36795
3 ! "(str)" (= an expression) was regarded as "str" (= a variable)
4 ! and thus when yy was deallocated so was xx. Result: An invalid
5 ! memory access.
7 program main
8 implicit none
9 character (len=10), allocatable :: str(:)
10 allocate (str(1))
11 str(1) = "dog"
12 if (size(str) /= 1 .or. str(1) /= "dog") STOP 1
13 contains
14 subroutine foo(xx,yy)
15 character (len=*), intent(in) :: xx(:)
16 character (len=*), intent(out), allocatable :: yy(:)
17 allocate (yy(size(xx)))
18 yy = xx
19 end subroutine foo
20 end program main