From ee7df531943f770e9c9e175b53586e6dd01ca617 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Sat, 18 Apr 2015 19:23:17 +0000 Subject: [PATCH] pr32627.f03 (strptr): Change size to match the number of non-nul characters. * gfortran.dg/pr32627.f03 (strptr): Change size to match the number of non-nul characters. * gfortran.dg/substr_6.f90: Make the NUL character visible on stdout From-SVN: r222214 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gfortran.dg/pr32627.f03 | 2 +- gcc/testsuite/gfortran.dg/substr_6.f90 | 11 ++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ee4f05f6853..b4052efcb97 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-04-18 Martin Sebor + + * gfortran.dg/pr32627.f03 (strptr): Change size to match the number + of non-nul characters. + * gfortran.dg/substr_6.f90: Make the NUL character visible on stdout + 2015-04-17 Bill Schmidt PR target/65787 diff --git a/gcc/testsuite/gfortran.dg/pr32627.f03 b/gcc/testsuite/gfortran.dg/pr32627.f03 index f8695e00642..d9e2b138506 100644 --- a/gcc/testsuite/gfortran.dg/pr32627.f03 +++ b/gcc/testsuite/gfortran.dg/pr32627.f03 @@ -18,7 +18,7 @@ program main type( c_ptr ) :: x type( A ), pointer :: fptr type( A ), target :: my_a_type - character( len=9 ), pointer :: strptr + character( len=8 ), pointer :: strptr fptr => my_a_type diff --git a/gcc/testsuite/gfortran.dg/substr_6.f90 b/gcc/testsuite/gfortran.dg/substr_6.f90 index 813a02521a3..a7cdc100ee6 100644 --- a/gcc/testsuite/gfortran.dg/substr_6.f90 +++ b/gcc/testsuite/gfortran.dg/substr_6.f90 @@ -11,6 +11,15 @@ if (c(1) /= " ") call abort() c = (/ c0(1)(1:5) /) do i=1,5 if (c(1)(i:i) /= c1(i)) call abort() + + ! Make NULs visible (and avoid corrupting text output). + if (c(1)(i:i) == ACHAR(0)) then + print "(a,$)", "" + else + print "(a,$)", c(1)(i:i) + end if end do -print *, c(1) + +print *, "" + end -- 2.30.2