]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libfortran/33253 (namelist: reading back a string with apostrophe)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 6 Sep 2007 01:24:17 +0000 (01:24 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 6 Sep 2007 01:24:17 +0000 (01:24 +0000)
2007-09-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libfortran/33253
* gfortran.dg/namelist_38.f90: Update test for DELIM= .

From-SVN: r128171

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/namelist_38.f90

index 6f749db86afd5f2ac345afb86471d4e850598a4e..b1cda56c88713fb986cd8059024fe504d44fbc6f 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/33253
+       * gfortran.dg/namelist_38.f90: Update test for DELIM= .
+
 2007-09-06  Jesper Nilsson  <jesper.nilsson@axis.com>
 
        * gcc.target/cris/builtin_ctz_v3.c: New testcase.
index 1fdb9cdfc1f464dca02670cdd8cf2e3efaff34aa..5578654eea48d8cc978a22cfc74b6cdfb3e6ae51 100644 (file)
@@ -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  <jvdelisle@gcc.gnu.org>
 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