On Thu, Oct 27, 2016 at 8:49 AM, Fritz Reese <fritzore...@gmail.com> wrote: > From: Fritz Reese <fritzore...@gmail.com> > Date: Thu, 27 Oct 2016 08:46:33 -0400 > Subject: [PATCH] Fix some DEC I/O testcases. > > gcc/testsuite/gfortran.dg/ > * dec_io_5.f90: Rename 'test.txt' to 'dec_io_5.txt'. > * dec_io_6.f90: Use 'dec_io_6.txt' and INQUIRE instead of XFAIL. > --- > gcc/testsuite/gfortran.dg/dec_io_5.f90 | 2 +- > gcc/testsuite/gfortran.dg/dec_io_6.f90 | 19 ++++++++++++++++--- > 2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/gcc/testsuite/gfortran.dg/dec_io_5.f90 b/gcc/testsuite/gfortran.dg/dec_io_5.f90 index 9d44c6e..a99aa76 100644 --- a/gcc/testsuite/gfortran.dg/dec_io_5.f90 +++ b/gcc/testsuite/gfortran.dg/dec_io_5.f90 @@ -8,7 +8,7 @@ implicit none integer :: fd = 8 -character(*), parameter :: f = "test.txt" +character(*), parameter :: f = "dec_io_5.txt" character(10), volatile :: c c = 'write' diff --git a/gcc/testsuite/gfortran.dg/dec_io_6.f90 b/gcc/testsuite/gfortran.dg/dec_io_6.f90 index a0c0256..c34879a 100644 --- a/gcc/testsuite/gfortran.dg/dec_io_6.f90 +++ b/gcc/testsuite/gfortran.dg/dec_io_6.f90 @@ -1,4 +1,4 @@ -! { dg-do run "xfail *-*-*" } +! { dg-do run } ! { dg-options "-fdec" } ! ! Test that we get a run-time error for close-on-delete with READONLY. @@ -7,9 +7,22 @@ implicit none integer :: fd = 8 -character(*), parameter :: f = "test.txt" +character(*), parameter :: f = "dec_io_6.txt" +logical :: exists + +open(unit=fd,file=f,action='write') +close(unit=fd) open(unit=fd,file=f,action='read',readonly) -close(unit=fd,status='delete') ! XFAIL "protected by READONLY" +close(unit=fd,status='delete') ! WARN "protected by READONLY" + +inquire(file=f, EXIST=exists) +if (.not. exists) then + print *, 'file was not protected by READONLY!' + call abort() +endif + +open(unit=fd,file=f,action='write') +close(unit=fd,status='delete') ! cleanup end