aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFritz Reese <fritzoreese@gmail.com>2016-10-27 14:14:44 +0000
committerFritz Reese <foreese@gcc.gnu.org>2016-10-27 14:14:44 +0000
commit9a6ac422ec269e12c88a852369bb3cc32c72c2b9 (patch)
treec610b577db8e3b24d9caaa5f11571c6a54da22e9
parent953f0758237ac909dcdd84d91d4c4dbfe787e40a (diff)
downloadgcc-9a6ac422ec269e12c88a852369bb3cc32c72c2b9.zip
gcc-9a6ac422ec269e12c88a852369bb3cc32c72c2b9.tar.gz
gcc-9a6ac422ec269e12c88a852369bb3cc32c72c2b9.tar.bz2
Fix some DEC I/O testcases.
gcc/testsuite/gfortran.dg/ * dec_io_5.f90, dec_io_6.f90: Don't use "test.txt", and use dg-shouldfail/dg-output instead of XFAIL. From-SVN: r241623
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gfortran.dg/dec_io_5.f908
-rw-r--r--gcc/testsuite/gfortran.dg/dec_io_6.f9022
3 files changed, 29 insertions, 7 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9e37729..22a9ce8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2016-10-27 Fritz Reese <fritzoreese@gmail.com>
+
+ * gfortran.dg/dec_io_5.f90: Don't use "test.txt", and use
+ dg-shouldfail/dg-output instead of XFAIL.
+ * gfortran.dg/dec_io_6.f90: Likewise.
+
2016-10-27 Thomas Preud'homme <thomas.preudhomme@arm.com>
* gcc.target/arm/atomic-comp-swap-release-acquire-3.c: New test.
diff --git a/gcc/testsuite/gfortran.dg/dec_io_5.f90 b/gcc/testsuite/gfortran.dg/dec_io_5.f90
index 9d44c6e..c6633a5 100644
--- a/gcc/testsuite/gfortran.dg/dec_io_5.f90
+++ b/gcc/testsuite/gfortran.dg/dec_io_5.f90
@@ -1,5 +1,6 @@
-! { dg-do run "xfail *-*-*" }
+! { dg-do run }
! { dg-options "-fdec" }
+! { dg-shouldfail "ACTION conflicts with READONLY" }
!
! Test that we get a run-time error for opening a READONLY file with
! ACTION='WRITE'.
@@ -8,10 +9,11 @@
implicit none
integer :: fd = 8
-character(*), parameter :: f = "test.txt"
+character(*), parameter :: f = "dec_io_5.txt"
character(10), volatile :: c
c = 'write'
-open(unit=fd,file=f,action=c,readonly) ! XFAIL "ACTION conflicts with READONLY"
+open(unit=fd,file=f,action=c,readonly)
end
+! { dg-output "ACTION conflicts with READONLY" }
diff --git a/gcc/testsuite/gfortran.dg/dec_io_6.f90 b/gcc/testsuite/gfortran.dg/dec_io_6.f90
index a0c0256..2dfaf9d 100644
--- a/gcc/testsuite/gfortran.dg/dec_io_6.f90
+++ b/gcc/testsuite/gfortran.dg/dec_io_6.f90
@@ -1,15 +1,29 @@
-! { dg-do run "xfail *-*-*" }
+! { dg-do run }
! { dg-options "-fdec" }
!
-! Test that we get a run-time error for close-on-delete with READONLY.
+! Test that we get a run-time warning for close-on-delete with READONLY,
+! and that the file is protected from deletion.
!
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') ! { dg-output "file 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