aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2007-09-07 20:23:40 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2007-09-07 20:23:40 +0000
commitdd36913ccfae33ac8c4e4071cadcfaab99c72ce5 (patch)
tree26ab295bcfe8eafc4f8d72a1eca6c7f2170a5b57 /gcc
parent3a6666054ec4af338a97fb9f1e60e1acec3e8d43 (diff)
downloadgcc-dd36913ccfae33ac8c4e4071cadcfaab99c72ce5.zip
gcc-dd36913ccfae33ac8c4e4071cadcfaab99c72ce5.tar.gz
gcc-dd36913ccfae33ac8c4e4071cadcfaab99c72ce5.tar.bz2
re PR fortran/33307 (I/O read/positioning problem)
2007-09-07 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/33307 * gfortran.dg/backspace_10.f90: New test. From-SVN: r128254
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/backspace_10.f9037
2 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f704b27..9ca621c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-07 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/33307
+ * gfortran.dg/backspace_10.f90: New test.
+
2007-09-07 Richard Guenther <rguenther@suse.de>
Reapply
diff --git a/gcc/testsuite/gfortran.dg/backspace_10.f90 b/gcc/testsuite/gfortran.dg/backspace_10.f90
new file mode 100644
index 0000000..574d464
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/backspace_10.f90
@@ -0,0 +1,37 @@
+! { dg-do run }
+! PR33307 I/O read/positioning problem - in BACKSPACE
+! Test case devloped from test in PR by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+program gfcbug69b
+ ! Modified example program
+ implicit none
+ integer, parameter :: iunit = 63
+ integer :: istat, k, ios
+ character(len=20) :: line, message
+
+ open (iunit)
+ write (iunit, '(a)') "! ***Remove this line***"
+ write (iunit, '(a)') "&FOO file='foo' /"
+ write (iunit, '(a)', advance="no") "&BAR file='bar' /"
+ close (iunit)
+! Note: Failure occurred only when ACTION="read" was specified
+ open (iunit, action="read", status="old")
+
+ read (iunit,'(a)',iostat=ios) line
+ if (ios /= 0) call abort
+ read (iunit,'(a)',iostat=ios) line
+ if (ios /= 0) call abort
+ read (iunit,'(a)',iostat=ios) line
+ if (ios /= 0) call abort
+ read (iunit,'(a)',iostat=ios) line
+ if (ios /= 0) backspace (iunit)
+ rewind (iunit)
+ read (iunit,'(a)',iostat=ios) line
+ if (ios /= 0) call abort
+ read (iunit,'(a)',iostat=ios) line
+ if (ios /= 0) call abort
+ read (iunit,'(a)',iostat=ios) line
+ if (ios /= 0) call abort
+ read (iunit,'(a)',iostat=ios) line
+ if (ios /= -1) call abort
+ close (iunit, status="delete")
+end program gfcbug69b