]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/69668 (Error reading namelist opened with DELIM='NONE')
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 12 Feb 2016 21:02:02 +0000 (21:02 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 12 Feb 2016 21:02:02 +0000 (21:02 +0000)
2016-02-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/69668
* gfortran.dg/namelist_88.f90: New test.

From-SVN: r233388

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

index 7bed3caf259b6aff8a5261e1675f7db3337e9e44..7fbd202c23c6b3c5eae6336aad54c7cf310a3449 100644 (file)
@@ -1,3 +1,8 @@
+2016-02-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/69668
+       * gfortran.dg/namelist_88.f90: New test.
+
 2016-02-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libgfortran/69668
diff --git a/gcc/testsuite/gfortran.dg/namelist_88.f90 b/gcc/testsuite/gfortran.dg/namelist_88.f90
new file mode 100644 (file)
index 0000000..0a6ac9b
--- /dev/null
@@ -0,0 +1,29 @@
+! { dg-do run }
+! PR69668 Error reading namelist opened with DELIM='NONE' 
+program namelist
+  implicit none
+
+  integer,parameter :: tabsz=10
+  integer :: i
+  character(len=10),dimension(tabsz) :: tab
+  namelist/tab_nml/tab
+
+  tab(:)='invalid'
+
+  ! Create a temporary test namelist file
+  open(unit=23,status='scratch',delim='none')
+  write(23,*) "&tab_nml"
+  write(23,*) "tab(1)='in1',"
+  write(23,*) "tab(2)='in2'"
+  write(23,*) "/"
+  rewind(23)
+
+  read(unit=23,nml=tab_nml)
+
+  close(unit=23)
+
+  if (tab(1).ne.'in1') call abort
+  if (tab(2).ne.'in2') call abort
+  if (any(tab(3:tabsz).ne.'invalid')) call abort
+
+end program namelist