diff options
author | Martin Sebor <msebor@redhat.com> | 2015-04-18 19:23:17 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2015-04-18 13:23:17 -0600 |
commit | ee7df531943f770e9c9e175b53586e6dd01ca617 (patch) | |
tree | 93db4b6996a02445459540923e49c718be63b4a9 | |
parent | 67f58944a75eaf9c193dc704f8128bfaaf6c3c3a (diff) | |
download | gcc-ee7df531943f770e9c9e175b53586e6dd01ca617.zip gcc-ee7df531943f770e9c9e175b53586e6dd01ca617.tar.gz gcc-ee7df531943f770e9c9e175b53586e6dd01ca617.tar.bz2 |
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
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr32627.f03 | 2 | ||||
-rw-r--r-- | 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 ee4f05f..b4052ef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-04-18 Martin Sebor <msebor@redhat.com> + + * 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 <wschmidt@linux.vnet.ibm.com> PR target/65787 diff --git a/gcc/testsuite/gfortran.dg/pr32627.f03 b/gcc/testsuite/gfortran.dg/pr32627.f03 index f8695e0..d9e2b13 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 813a025..a7cdc10 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,$)", "<NUL>" + else + print "(a,$)", c(1)(i:i) + end if end do -print *, c(1) + +print *, "" + end |