PR libfortran/33253
* gfortran.dg/namelist_38.f90: New test.
* gfortran.dg/namelist_39.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128975
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-10-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/33253
+ * gfortran.dg/namelist_38.f90: New test.
+ * gfortran.dg/namelist_39.f90: New test.
+
2007-10-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR libfortran/33469
--- /dev/null
+! { dg-do run }
+! 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=3) :: a
+ namelist /foo/ 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
--- /dev/null
+! { dg-do run }
+! PR33421 and PR33253 Weird quotation of namelist output of character arrays
+! Test case from Toon Moene, adapted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+program test
+implicit none
+character(len=45) :: b(3)
+namelist /nam/ b
+b = 'x'
+open(99, status="scratch")
+write(99,'(4(a,/),a)') "&NAM", &
+ " b(1)=' AAP NOOT MIES WIM ZUS JET',", &
+ " b(2)='SURF.PRESSURE',", &
+ " b(3)='APEKOOL',", &
+ " /"
+rewind(99)
+read(99,nml=nam)
+close(99)
+
+if (b(1).ne." AAP NOOT MIES WIM ZUS JET ") call abort
+if (b(2).ne."SURF.PRESSURE ") call abort
+if (b(3).ne."APEKOOL ") call abort
+
+end program test
+