re PR libfortran/33253 (namelist: reading back a string with apostrophe)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Mon, 3 Sep 2007 19:27:48 +0000 (19:27 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Mon, 3 Sep 2007 19:27:48 +0000 (19:27 +0000)
2007-09-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/33253
* gfortran.dg/namelist_15.f90: Update test.
* gfortran.dg/namelist_24.f90: Update test.
* gfortran.dg/namelist_38.f90: New test.

From-SVN: r128056

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/namelist_15.f90
gcc/testsuite/gfortran.dg/namelist_24.f90
gcc/testsuite/gfortran.dg/namelist_38.f90 [new file with mode: 0644]

index 4d35334dd22f754cd374185bd42485beff5a20d4..e98ef3425445374ac1f7ad138467b5b1affed79e 100644 (file)
@@ -1,3 +1,10 @@
+2007-09-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/33253
+       * gfortran.dg/namelist_15.f90: Update test.
+       * gfortran.dg/namelist_24.f90: Update test.
+       * gfortran.dg/namelist_38.f90: New test.
+
 2007-09-03  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c: Restored.  Moved
index 7bfe93109797152475a6e59650aa3778d7c0b8cd..233cf2275fce333d8f443029f19661b612d542a2 100644 (file)
@@ -20,7 +20,7 @@ program namelist_15
 
   namelist /mynml/ x
 
-  open (10, status = "scratch")
+  open (10, status = "scratch", delim='apostrophe')
   write (10, '(A)') "&MYNML"
   write (10, '(A)') " x = 3, 4, 'dd', 'ee', 'ff', 'gg',"
   write (10, '(A)') "     4, 5, 'hh', 'ii', 'jj', 'kk',"
index 4e60269c1da289dfcb29746227eb517311ddc490..11cd2d0a4666a6958d0e2f745df38eb40779ea6a 100644 (file)
@@ -11,7 +11,7 @@
       character*(8) names2(nd,nd)
       character*(8) names3(nd,nd)
       namelist / mynml /  names, names2, names3
-      open(unit=20,status='scratch')
+      open(unit=20,status='scratch', delim='apostrophe')
       write (20, '(a)') "&MYNML"
       write (20, '(a)') "NAMES = 25*'0'"
       write (20, '(a)') "NAMES2 = 25*'0'"
diff --git a/gcc/testsuite/gfortran.dg/namelist_38.f90 b/gcc/testsuite/gfortran.dg/namelist_38.f90
new file mode 100644 (file)
index 0000000..1fdb9cd
--- /dev/null
@@ -0,0 +1,17 @@
+! { dg-do run }
+! PR33253 namelist: reading back a string
+! Test case modified from that of the PR by
+! Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+program main
+  implicit none
+  character(len=8) :: a
+  namelist /foo/ a
+  open(10, status="scratch")
+  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)
+end program main