aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2009-08-02 18:47:46 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2009-08-02 18:47:46 +0000
commit9a1425dac2737d697ed3182d36d4be031a0639c6 (patch)
tree9cdd4ce1d33023dadb3f216527d1a8d4d0097254 /gcc
parentba286d56964f5232eac0b8e87780fd229c57b73c (diff)
downloadgcc-9a1425dac2737d697ed3182d36d4be031a0639c6.zip
gcc-9a1425dac2737d697ed3182d36d4be031a0639c6.tar.gz
gcc-9a1425dac2737d697ed3182d36d4be031a0639c6.tar.bz2
re PR fortran/40853 (I/O: Namelist read error)
2009-08-02 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/40853 * gfortran.dg/namelist_40.f90: Update error output. * gfortran.dg/namelist_47.f90: Update error output. * gfortran.dg/namelist_58.f90: New test. From-SVN: r150357
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_40.f902
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_47.f902
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_58.f9025
4 files changed, 34 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d01a1a7..ad74f37 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-02 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/40853
+ * gfortran.dg/namelist_40.f90: Update error output.
+ * gfortran.dg/namelist_47.f90: Update error output.
+ * gfortran.dg/namelist_58.f90: New test.
+
2009-08-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/40881
diff --git a/gcc/testsuite/gfortran.dg/namelist_40.f90 b/gcc/testsuite/gfortran.dg/namelist_40.f90
index 3c9d813..d6f896a 100644
--- a/gcc/testsuite/gfortran.dg/namelist_40.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_40.f90
@@ -47,7 +47,7 @@ subroutine writenml (astring)
end subroutine writenml
end program namelist_40
-! { dg-output "Multiple sub-objects with non-zero rank in namelist object x(\n|\r\n|\r)" }
+! { dg-output "Multiple sub-objects with non-zero rank in namelist object x%m%ch(\n|\r\n|\r)" }
! { dg-output "Missing colon in substring qualifier for namelist variable x%m%ch(\n|\r\n|\r)" }
! { dg-output "Substring out of range for namelist variable x%m%ch(\n|\r\n|\r)" }
! { dg-output "Bad character in substring qualifier for namelist variable x%m%ch(\n|\r\n|\r)" }
diff --git a/gcc/testsuite/gfortran.dg/namelist_47.f90 b/gcc/testsuite/gfortran.dg/namelist_47.f90
index bc9110f..5819247 100644
--- a/gcc/testsuite/gfortran.dg/namelist_47.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_47.f90
@@ -45,7 +45,7 @@ subroutine writenml (astring)
end subroutine writenml
end program namelist_47
-! { dg-output "Multiple sub-objects with non-zero rank in namelist object x(\n|\r\n|\r)" }
+! { dg-output "Multiple sub-objects with non-zero rank in namelist object x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }
! { dg-output "Missing colon in substring qualifier for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }
! { dg-output "Substring out of range for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }
! { dg-output "Bad character in substring qualifier for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" }
diff --git a/gcc/testsuite/gfortran.dg/namelist_58.f90 b/gcc/testsuite/gfortran.dg/namelist_58.f90
new file mode 100644
index 0000000..fcce016
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_58.f90
@@ -0,0 +1,25 @@
+! { dg-do run }
+! PR40853 Error in namelist IO.
+! Test case derived from example given in PR. < jvdelisle@gcc.gnu.org >
+program test
+ implicit none
+ type tao_title_struct
+ character(2) justify
+ end type
+ type tao_plot_page_struct
+ real shape_height_max
+ type (tao_title_struct) title ! Comment this line out and the bug goes away.
+ real size(2)
+ end type
+ type (tao_plot_page_struct) plot_page
+ namelist / params / plot_page
+ open (10, status="scratch")
+ write(10,'(a)')" &params"
+ write(10,'(a)')" plot_page%size=5 , 2,"
+ write(10,'(a)')"/"
+ rewind(10)
+ read (10, nml = params)
+ if (any(plot_page%size .ne. (/ 5, 2 /))) call abort
+ close (10)
+end program
+