From db44b39f4f9a464b9277dc5bbc1fba362a954ec0 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Thu, 6 Sep 2007 01:24:17 +0000 Subject: [PATCH] re PR libfortran/33253 (namelist: reading back a string with apostrophe) 2007-09-06 Jerry DeLisle PR libfortran/33253 * gfortran.dg/namelist_38.f90: Update test for DELIM= . From-SVN: r128171 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/namelist_38.f90 | 27 +++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6f749db86af..b1cda56c887 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-09-06 Jerry DeLisle + + PR libfortran/33253 + * gfortran.dg/namelist_38.f90: Update test for DELIM= . + 2007-09-06 Jesper Nilsson * gcc.target/cris/builtin_ctz_v3.c: New testcase. diff --git a/gcc/testsuite/gfortran.dg/namelist_38.f90 b/gcc/testsuite/gfortran.dg/namelist_38.f90 index 1fdb9cdfc1f..5578654eea4 100644 --- a/gcc/testsuite/gfortran.dg/namelist_38.f90 +++ b/gcc/testsuite/gfortran.dg/namelist_38.f90 @@ -1,17 +1,36 @@ ! { dg-do run } -! PR33253 namelist: reading back a string +! PR33253 namelist: reading back a string, also fixed writing with delimiters. ! Test case modified from that of the PR by ! Jerry DeLisle program main implicit none - character(len=8) :: a + character(len=3) :: a namelist /foo/ a - open(10, status="scratch") - a = "a'a" + + open(10, status="scratch", delim="quote") + a = 'a"a' write(10,foo) rewind 10 a = "" read (10,foo) ! This gave a runtime error before the patch. + if (a.ne.'a"a') call abort + close (10) + + open(10, status="scratch", delim="apostrophe") + a = "a'a" + write(10,foo) + rewind 10 + a = "" + read (10,foo) + if (a.ne."a'a") call abort + close (10) + + open(10, status="scratch", delim="none") + a = "a'a" + write(10,foo) + rewind 10 + a = "" + read (10,foo) if (a.ne."a'a") call abort close (10) end program main -- 2.30.2