comparison gcc/testsuite/gfortran.dg/value_7.f03 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
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 ') call abort()
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') call abort()
20 end subroutine sub2
21 end program test
22