PR 48587 Newunit allocator
authorJanne Blomqvist <jb@gcc.gnu.org>
Sat, 15 Oct 2016 13:15:26 +0000 (16:15 +0300)
committerJanne Blomqvist <jb@gcc.gnu.org>
Sat, 15 Oct 2016 13:15:26 +0000 (16:15 +0300)
2016-10-15  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/48587
        * gfortran.dg/negative_unit2.f90: New testcase.

From-SVN: r241200

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

diff --git a/gcc/testsuite/gfortran.dg/negative_unit2.f90 b/gcc/testsuite/gfortran.dg/negative_unit2.f90
new file mode 100644 (file)
index 0000000..e7fb85e
--- /dev/null
@@ -0,0 +1,9 @@
+! { dg-do run }
+! Test case submitted by Dominique d'Humieres
+program negative_unit2
+  integer :: i, j
+  ! i should be <= NEWUNIT_FIRST in libgfortran/io/unit.c
+  i = -100
+  write(unit=i,fmt=*, iostat=j) 10
+  if (j == 0) call abort
+end program negative_unit2