diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ef5e04a5afb..45a3afbe9de 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-09-30 Jerry DeLisle + + PR libfortran/33400 + * gfortran.dg/PR19872.f: Fix test condition. + * gfortran.dg/list_read_7.f90: New test. + 2007-09-30 Uros Bizjak PR tree-optimization/33597 diff --git a/gcc/testsuite/gfortran.dg/PR19872.f b/gcc/testsuite/gfortran.dg/PR19872.f index dda9a8bdf9d..12bba3352a2 100644 --- a/gcc/testsuite/gfortran.dg/PR19872.f +++ b/gcc/testsuite/gfortran.dg/PR19872.f @@ -11,10 +11,10 @@ close(1) open(1,form='FORMATTED') read(1,*)i - if(i(1).ne.9.and.i(2).ne.8.and.i(3).ne.7.and.i(4).ne.9)call abort - read(1,*,end=200)i + if(i(1).ne.9.or.i(2).ne.8.or.i(3).ne.7.or.i(4).ne.6)call abort + read(1,*, end=200)i ! should only be able to read one line from the file call abort 200 continue - close(1,STATUS='DELETE') + close(1,STATUS='delete') end diff --git a/gcc/testsuite/gfortran.dg/list_read_7.f90 b/gcc/testsuite/gfortran.dg/list_read_7.f90 new file mode 100644 index 00000000000..5db89959e87 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/list_read_7.f90 @@ -0,0 +1,17 @@ +! { dg-do run } +! PR33400 Formatted read fails if line ends without line break +! Test case modified from that in PR by +integer, parameter :: fgsl_strmax = 128 +character(len=fgsl_strmax) :: ieee_str1, ieee_str2 +open(unit=20, file='test.dat',form='FORMATTED') +write(20,'(a)',advance="no") ' 1.01010101010101010101010101010101& + &01010101010101010101*2^-2 1.01010101010101010101011*2^-2' +rewind(20) +read(20, fmt=*) ieee_str1, ieee_str2 +if (trim(ieee_str1) /= & + '1.0101010101010101010101010101010101010101010101010101*2^-2') & + call abort +if (trim(ieee_str2) /= & + '1.01010101010101010101011*2^-2') & + call abort +end