diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2005-03-31 17:30:06 +0200 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2005-03-31 15:30:06 +0000 |
commit | 14fd645e24c0924bbcc0a7f5fa85b7534cd3c4f2 (patch) | |
tree | f9c088e9e155088b3460b11a74badd8a49363196 /gcc | |
parent | 406490a8492a82c538db3aa6b43b5cffb9d05b42 (diff) | |
download | gcc-14fd645e24c0924bbcc0a7f5fa85b7534cd3c4f2.zip gcc-14fd645e24c0924bbcc0a7f5fa85b7534cd3c4f2.tar.gz gcc-14fd645e24c0924bbcc0a7f5fa85b7534cd3c4f2.tar.bz2 |
re PR libfortran/20660 (INQUIRE incorrectly reports the existence of UNITS)
PR libfortran/20660
* io/inquire.c (inquire_via_unit): Non-opened units should still be
reported by an INQUIRE statement as existing.
* io/transfer.c (data_transfer_init): Never accept negative units.
PR libfortran/20660
* gfortran.dg/negative_unit.f: New test.
From-SVN: r97326
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/negative_unit.f | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4d30efb..b6714aa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-03-31 Francois-Xavier Coudert <coudert@clipper.ens.fr> + + PR libfortran/20660 + * gfortran.dg/negative_unit.f: New test. + 2005-03-31 Mostafa Hagog <mustafa@il.ibm.com> * gcc.dg/20050330-1.c: New test. diff --git a/gcc/testsuite/gfortran.dg/negative_unit.f b/gcc/testsuite/gfortran.dg/negative_unit.f new file mode 100644 index 0000000..ba0d3cd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/negative_unit.f @@ -0,0 +1,22 @@ +! {dg-do run} +! +! PR libfortran/20660 and other bugs (not filed in bugzilla) relating +! to negative units +! +! Bugs submitted by Walt Brainerd + integer i + logical l + + i = 0 +! gfortran created a 'fort.-1' file and wrote "Hello" in it + write (unit=-1, fmt=*, iostat=i) "Hello" + if (i <= 0) call abort + + i = 0 + open (unit=-11, file="xxx", iostat=i) + if (i <= 0) call abort + + inquire (unit=-42, exist=l) + if (l) call abort + + end |