summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/value_7.f03
blob: 24395778ec71aeba75f255a5b271209f3e4841fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! { dg-do run }
! Test passing character strings by-value.
! PR fortran/32732
program test
  implicit none
  character(len=13) :: chr
  chr =  'Fortran       '
  call sub1(chr)
  if(chr /= 'Fortran       ') call abort()
contains
  subroutine sub1(a)
    character(len=13), VALUE :: a
    a = trim(a)//" rules"
    call sub2(a)        
  end subroutine sub1
  subroutine sub2(a)
    character(len=13), VALUE :: a
    print *, a          
    if(a /= 'Fortran rules') call abort()
  end subroutine sub2
end program test