re PR fortran/40853 (I/O: Namelist read error)

2009-08-04  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: r150477
This commit is contained in:
Jerry DeLisle 2009-08-05 03:17:52 +00:00
parent 451a2c55e3
commit 1df75b8c55
4 changed files with 36 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2009-08-04 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-04 Dodji Seketeli <dodji@redhat.com>
PR c++/39987

View File

@ -1,4 +1,4 @@
! { dg-do run { target fd_truncate } }
! { dg-do run }
! PR33672 Additional runtime checks needed for namelist reads
! Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
@ -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)" }

View File

@ -1,4 +1,4 @@
! { dg-do run { target fd_truncate } }
! { dg-do run }
module nml_47
type :: mt
@ -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)" }

View File

@ -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