diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-03-11 02:26:36 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-03-11 02:26:36 +0000 |
commit | e1061681b93e842d8317043e1accf3491a37d1f7 (patch) | |
tree | 0dde9f08973d8622322ab999466060db1374efea /gcc | |
parent | b7137299f1070a262d927bc850823202e6014566 (diff) | |
download | gcc-e1061681b93e842d8317043e1accf3491a37d1f7.zip gcc-e1061681b93e842d8317043e1accf3491a37d1f7.tar.gz gcc-e1061681b93e842d8317043e1accf3491a37d1f7.tar.bz2 |
re PR libfortran/43320 (200.sixtrack fails setup)
2010-03-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/43320
PR libfortran/43265
* gfortran.dg/read_eof_6.f: New test
* gfortran.dg/read_x_eof.f90: Update test.
* gfortran.dg/read_x_past.f: Update test.
From-SVN: r157378
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/read_eof_6.f | 7 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/read_x_eof.f90 | 16 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/read_x_past.f | 11 |
4 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ebabe97..75a85ee 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2010-03-10 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/43320 + PR libfortran/43265 + * gfortran.dg/read_eof_6.f: New test + * gfortran.dg/read_x_eof.f90: Update test. + * gfortran.dg/read_x_past.f: Update test. + 2010-03-10 Jan Hubicka <jh@suse.cz> * gcc.dg/compile/pr43288.c: New test. diff --git a/gcc/testsuite/gfortran.dg/read_eof_6.f b/gcc/testsuite/gfortran.dg/read_eof_6.f new file mode 100644 index 0000000..d407748 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/read_eof_6.f @@ -0,0 +1,7 @@ +! { dg-do run } +! PR43320 Missing EOF on read from empty file. + open(8,status='scratch',form='formatted') ! Create empty file + read(8,'(a80)', end=123) ! Reading from an empty file should be an EOF + call abort +123 continue + end diff --git a/gcc/testsuite/gfortran.dg/read_x_eof.f90 b/gcc/testsuite/gfortran.dg/read_x_eof.f90 new file mode 100644 index 0000000..f79f785 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/read_x_eof.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! PR43265 No EOF condition if reading with '(x)' from an empty file +! Test case from the reporter. +program pr43265 +implicit none +integer::i +open(23,status="scratch") +write(23,'(a)') "Line 1" +write(23,'(a)') "Line 2" +write(23,'(a)') "Line 3" +rewind(23) +do i=1,10 + read(23,'(1x)',end=12) +enddo +12 if (i.ne.4) call abort +end diff --git a/gcc/testsuite/gfortran.dg/read_x_past.f b/gcc/testsuite/gfortran.dg/read_x_past.f index 3d6b012..eee68d3 100644 --- a/gcc/testsuite/gfortran.dg/read_x_past.f +++ b/gcc/testsuite/gfortran.dg/read_x_past.f @@ -2,6 +2,7 @@ ! { dg-options -w } ! PR 26661 : Test reading X's past file end with no LF or CR. ! PR 26880 : Tests that rewind clears the gfc_unit read_bad flag. +! PR 43265 : Tests that no error occurs with or without X at end. ! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>. implicit none character(3) a(4) @@ -10,8 +11,18 @@ 10 format(A,$) ! This is not pedantic write(10,10)' abc def ghi jkl' rewind(10) + + a = "" read(10,20)(a(i),i=1,4) if (a(4).ne."jkl") call abort() + + rewind(10) + + a = "" + read(10,30)(a(i),i=1,4) + if (a(4).ne."jkl") call abort() + 20 format(1x,a3,1x,a3,1x,a3,1x,a3,10x) + 30 format(1x,a3,1x,a3,1x,a3,1x,a3) close(10) end |