PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / value_7.f03
blob31ca0863ad5b462973bf632f3d05f5334eb9236e
1 ! { dg-do run }
2 ! Test passing character strings by-value.
3 ! PR fortran/32732
4 program test
5   implicit none
6   character(len=13) :: chr
7   chr =  'Fortran       '
8   call sub1(chr)
9   if(chr /= 'Fortran       ') STOP 1
10 contains
11   subroutine sub1(a)
12     character(len=13), VALUE :: a
13     a = trim(a)//" rules"
14     call sub2(a)        
15   end subroutine sub1
16   subroutine sub2(a)
17     character(len=13), VALUE :: a
18     print *, a          
19     if(a /= 'Fortran rules') STOP 2
20   end subroutine sub2
21 end program test