From: Jerry DeLisle Date: Sun, 31 Mar 2013 20:37:19 +0000 (+0000) Subject: re PR libfortran/56786 (Namelist read fails with designators containing embedded... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5ae7dac5c9ad68ad136f64a2670466c0891da02e;p=gcc.git re PR libfortran/56786 (Namelist read fails with designators containing embedded spaces) 2013-03-31 Jerry DeLisle PR fortran/56786 * gfortran.dg/namelist_81.f90: New test. From-SVN: r197291 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a152083c1ea..48bebd0fe5e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-03-31 Jerry DeLisle + + PR fortran/56786 + * gfortran.dg/namelist_81.f90: New test. + 2013-03-30 Thomas Koenig * gfortran.dg/character_comparison_3.f90: Adjust for use of memcmp diff --git a/gcc/testsuite/gfortran.dg/namelist_81.f90 b/gcc/testsuite/gfortran.dg/namelist_81.f90 new file mode 100644 index 00000000000..ddb100bf882 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_81.f90 @@ -0,0 +1,43 @@ +! { 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