[gomp] Fix inquire exist=x
Jakub Jelinek
jakub@redhat.com
Thu Nov 10 17:23:00 GMT 2005
Hi!
I apparently made a pasto when converting inquire. Have eyeballed the whole
file if similar inconsistency between the variable that is being set and
its name flag isn't present.
2005-11-10 Jakub Jelinek <jakub@redhat.com>
PR fortran/24774
* io/inquire.c (inquire_via_filename): Fix a typo in has_exist flag
name.
testsuite/
* gfortran.dg/inquire_9.f90: New test.
--- libgfortran/io/inquire.c.jj 2005-10-28 23:10:02.000000000 +0200
+++ libgfortran/io/inquire.c 2005-11-10 17:29:31.000000000 +0100
@@ -295,7 +295,7 @@ inquire_via_filename (st_parameter_inqui
const char *p;
GFC_INTEGER_4 cf = iqp->common.flags;
- if ((cf & IOPARM_INQUIRE_HAS_PAD) != 0)
+ if ((cf & IOPARM_INQUIRE_HAS_EXIST) != 0)
*iqp->exist = file_exists (iqp->file, iqp->file_len);
if ((cf & IOPARM_INQUIRE_HAS_OPENED) != 0)
--- gcc/testsuite/gfortran.dg/inquire_9.f90.jj 2005-11-10 17:44:03.000000000 +0100
+++ gcc/testsuite/gfortran.dg/inquire_9.f90 2005-11-10 17:48:46.000000000 +0100
@@ -0,0 +1,24 @@
+! PR fortran/24774
+! { dg-do run }
+ logical :: l
+ l = .true.
+ inquire (file='inquire_9 file that should not exist', exist=l)
+ if (l) call abort
+ l = .true.
+ inquire (unit=-16, exist=l)
+ if (l) call abort
+ open (unit=16, file='inquire_9.tst')
+ print (unit=16, fmt='(a)'), 'Test'
+ l = .false.
+ inquire (unit=16, exist=l)
+ if (.not.l) call abort
+ l = .false.
+ inquire (file='inquire_9.tst', exist=l)
+ if (.not.l) call abort
+ close (unit=16)
+ l = .false.
+ inquire (file='inquire_9.tst', exist=l)
+ if (.not.l) call abort
+ open (unit=16, file='inquire_9.tst')
+ close (unit=16, status='delete')
+end
Jakub
More information about the Fortran
mailing list