Commit 5ae7dac5 by Jerry DeLisle

re PR libfortran/56786 (Namelist read fails with designators containing embedded spaces)

2013-03-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/56786
	* gfortran.dg/namelist_81.f90:  New test.

From-SVN: r197291
parent 83437e67
2013-03-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/56786
* gfortran.dg/namelist_81.f90: New test.
2013-03-30 Thomas Koenig <tkoenig@gcc.gnu.org>
* gfortran.dg/character_comparison_3.f90: Adjust for use of memcmp
......
! { dg-do run }
! PR56786 Error on embedded spaces
integer :: i(3)
namelist /nml/ i
i = -42
open(99,status='scratch')
write(99,'(a)') '&nml i(3 ) = 5 /'
rewind(99)
read(99,nml=nml)
close(99)
if (i(1)/=-42 .or. i(2)/=-42 .or. i(3)/=5) call abort()
! Shorten the file so the read hits EOF
open(99,status='scratch')
write(99,'(a)') '&nml i(3 ) = 5 '
rewind(99)
read(99,nml=nml, end=30)
call abort()
! Shorten some more
30 close(99)
open(99,status='scratch')
write(99,'(a)') '&nml i(3 ) ='
rewind(99)
read(99,nml=nml, end=40)
call abort()
! Shorten some more
40 close(99)
open(99,status='scratch')
write(99,'(a)') '&nml i(3 )'
rewind(99)
read(99,nml=nml, end=50)
call abort()
! Shorten some more
50 close(99)
open(99,status='scratch')
write(99,'(a)') '&nml i(3 '
rewind(99)
read(99,nml=nml, end=60)
call abort()
60 close(99)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment