[PATCH, Fortran] DEC Compatibility: New I/O Specifiers CARRIAGECONTROL, READONLY, SHARE with -fdec

Jakub Jelinek jakub@redhat.com
Thu Oct 27 11:20:00 GMT 2016


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



More information about the Gcc-patches mailing list