re PR libfortran/48960 (OPEN statement modifies NEWUNIT variable on error)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 27 Dec 2012 20:13:35 +0000 (20:13 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 27 Dec 2012 20:13:35 +0000 (20:13 +0000)
2012-12-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/48960
* gfortran.dg/newunit_3.f90: New.

From-SVN: r194738

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/newunit_3.f90 [new file with mode: 0644]

index 1237fb9..ffe56e9 100644 (file)
@@ -1,5 +1,10 @@
 2012-12-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
+       PR fortran/48960
+       * gfortran.dg/newunit_3.f90: New.
+
+2012-12-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
        PR fortran/48976
        * gfortran.dg/inquire_15.f90: New.
 
diff --git a/gcc/testsuite/gfortran.dg/newunit_3.f90 b/gcc/testsuite/gfortran.dg/newunit_3.f90
new file mode 100644 (file)
index 0000000..b79a970
--- /dev/null
@@ -0,0 +1,6 @@
+! PR48960 On ERROR newunit should not modify user variable.
+program test_newunit
+    integer :: st, un = 0
+    open (newunit=un, file='nonexisting.dat', status='old', iostat=st)
+    if (un /= 0) call abort
+end program test_newunit