+2010-02-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/42901
+ * gfortran.dg/namelist_60.f90: New test.
+ * gfortran.dg/namelist_59.f90: New test.
+ * gcc/testsuite/gfortran.dg/namelist_47.f90: Update test.
+ * gcc/testsuite/gfortran.dg/namelist_40.f90: Update test.
+
2010-02-04 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/42952
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)" }
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)" }
--- /dev/null
+! { dg-do run }
+! PR41192 NAMELIST input with just a comment ("&NAME ! comment \") error
+program cmdline
+! comment by itself causes error in gfortran
+ call process(' ')
+ call process('i=10 , j=20 k=30 ! change all three values')
+ call process(' ')
+ call process('! change no values')! before patch this failed.
+end program cmdline
+
+subroutine process(string)
+ implicit none
+ character(len=*) :: string
+ character(len=132) :: lines(3)
+ character(len=255) :: message
+ integer :: i=1,j=2,k=3
+ integer ios
+ namelist /cmd/ i,j,k
+ save cmd
+ lines(1)='&cmd'
+ lines(2)=string
+ lines(3)='/'
+
+ read(lines,nml=cmd,iostat=ios,iomsg=message)
+ if (ios.ne.0) call abort
+end subroutine process
--- /dev/null
+! { dg-do run }
+! PR42901 Reading array of structures from namelist
+! Test case derived from the reporters test case.
+program test_nml
+type field_descr
+ integer number
+end type
+type fsetup
+ type (field_descr), dimension(3) :: vel ! 3 velocity components
+end type
+type (fsetup) field_setup
+namelist /nl_setup/ field_setup
+field_setup%vel%number = 0
+! write(*,nml=nl_setup)
+open(10, status="scratch")
+write(10,'(a)') "&nl_setup"
+write(10,'(a)') " field_setup%vel(1)%number= 3,"
+write(10,'(a)') " field_setup%vel(2)%number= 9,"
+write(10,'(a)') " field_setup%vel(3)%number= 27,"
+write(10,'(a)') "/"
+rewind(10)
+read(10,nml=nl_setup)
+if (field_setup%vel(1)%number .ne. 3) call abort
+if (field_setup%vel(2)%number .ne. 9) call abort
+if (field_setup%vel(3)%number .ne. 27) call abort
+! write(*,nml=nl_setup)
+end program test_nml