On Thu, Oct 27, 2016 at 7:02 AM Andreas Schwab <sch...@suse.de> wrote:
...
> 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
>

Indeed.

From: Fritz Reese <fritzore...@gmail.com>
Date: Thu, 27 Oct 2016 07:07:43 -0400
Subject: [PATCH] Fix open of nonexistant file in DEC I/O testcase.

        gcc/testsuite/gfortran.dg/
        * dec_io_5.f90: Rename 'test.txt' to 'dec_io_5.txt'
        * dec_io_6.f90: Create 'dec_io_6.txt' before reading it
---
 gcc/testsuite/gfortran.dg/dec_io_5.f90 |    2 +-
 gcc/testsuite/gfortran.dg/dec_io_6.f90 |    8 +++++++-
 2 files changed, 8 insertions(+), 2 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..3c9ae5d 100644
--- a/gcc/testsuite/gfortran.dg/dec_io_6.f90
+++ b/gcc/testsuite/gfortran.dg/dec_io_6.f90
@@ -7,9 +7,15 @@
 implicit none
 
 integer :: fd = 8
-character(*), parameter :: f = "test.txt"
+character(*), parameter :: f = "dec_io_6.txt"
+
+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"
 
+open(unit=fd,file=f,action='write')
+close(unit=fd,status='delete')
+
 end

Reply via email to