summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/iostat_1.f90
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-29 20:40:02 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-29 20:40:02 +0000
commit59a000b8b528b28bb13eafd52f867f3b3c50fc12 (patch)
treebc29b9e028673558a3d81e84dae7800d4cf5877a /gcc/testsuite/gfortran.dg/iostat_1.f90
parent04e684e39c30989c60268a8d571bbc90c44d68f2 (diff)
downloadgcc-59a000b8b528b28bb13eafd52f867f3b3c50fc12.tar.gz
2005-08-29 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/23598 * io/lock.c(library_start): If ioparm.iostat is present, clear it unconditionally. 2005-02-29 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/23598 * gfortran.dg/iostat_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103613 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg/iostat_1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/iostat_1.f9014
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/iostat_1.f90 b/gcc/testsuite/gfortran.dg/iostat_1.f90
new file mode 100644
index 00000000000..79bc0018fbd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/iostat_1.f90
@@ -0,0 +1,14 @@
+! { dg-do run }
+! PR 23598 - The iostat variable wasn't reset if the previous
+! I/O library call had an error.
+program main
+ implicit none
+ integer :: ios, i
+ open (10, pad='no', status='scratch')
+ write (10, '(A)') '1','1'
+ rewind (10)
+ read (10,'(I2)',iostat=ios) i
+ ios = -4321
+ read (10, '(I1)', iostat=ios) i
+ if (ios /= 0) call abort
+end program main