This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, Fortran] DEC Compatibility: New I/O Specifiers CARRIAGECONTROL, READONLY, SHARE with -fdec
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Fritz Reese <fritzoreese at gmail dot com>, fortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 27 Oct 2016 13:17:41 +0200
- Subject: Re: [PATCH, Fortran] DEC Compatibility: New I/O Specifiers CARRIAGECONTROL, READONLY, SHARE with -fdec
- Authentication-results: sourceware.org; auth=none
- References: <CAE4aFAnV=1jAtaaj08f2CjLYVBf9T5yBL8v37GgMTU-0MJ+nhQ@mail.gmail.com> <mvmy41agim0.fsf@hawking.suse.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Oct 27, 2016 at 01:02:31PM +0200, Andreas Schwab wrote:
> On Okt 25 2016, Fritz Reese <fritzoreese@gmail.com> wrote:
>
> > diff --git a/gcc/testsuite/gfortran.dg/dec_io_6.f90 b/gcc/testsuite/gfortran.dg/dec_io_6.f90
> > new file mode 100644
> > index 0000000..a0c0256
> > --- /dev/null
> > +++ b/gcc/testsuite/gfortran.dg/dec_io_6.f90
> > @@ -0,0 +1,15 @@
> > +! { dg-do run "xfail *-*-*" }
> > +! { dg-options "-fdec" }
> > +!
> > +! Test that we get a run-time error for close-on-delete with READONLY.
> > +!
> > +
> > +implicit none
> > +
> > +integer :: fd = 8
> > +character(*), parameter :: f = "test.txt"
> > +
> > +open(unit=fd,file=f,action='read',readonly)
> > +close(unit=fd,status='delete') ! XFAIL "protected by READONLY"
> > +
> > +end
>
> At line 12 of file /usr/local/gcc/gcc-20161027/gcc/testsuite/gfortran.dg/dec_io_6.f90 (unit = 8)
> Fortran runtime error: Cannot open file 'test.txt': No such file or directory
Seems dec_io_6.f90 assumes that dec_io_5.f90 creates test.txt and
dec_io_6.f90 will then read it and remove.
But that is just wrong assumption when using make -jN check-gfortran,
each test could be run in a different directory.
Jakub