This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, libgfortran, committed] PR 64770 Segfault when trying to open existing file with status="new"
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org, schwab at linux-m68k dot org, blomqvist dot janne at gmail dot com
- Date: Sun, 25 Jan 2015 10:35:50 +0100
- Subject: Re: [PATCH, libgfortran, committed] PR 64770 Segfault when trying to open existing file with status="new"
- Authentication-results: sourceware.org; auth=none
> ... FAIL: gfortran.dg/open_new_segv.f90 -O0 execution test
This is fixed with something such as
--- ../_clean/gcc/testsuite/gfortran.dg/open_new_segv.f90 2015-01-25 00:37:43.000000000 +0100
+++ gcc/testsuite/gfortran.dg/open_new_segv.f90 2015-01-25 10:31:40.000000000 +0100
@@ -1,4 +1,5 @@
! { dg-do run }
+! { dg-shouldfail "File already exists" }
! PR 64770 SIGSEGV when trying to open an existing file with status="new"
program pr64770
implicit none
@@ -8,3 +9,5 @@ program pr64770
open(99, file="pr64770test.dat", access="stream", form="unformatted", &
status="new")
end program pr64770
+! { dg-output "At line 10 of file.*" }
+! { dg-output "Fortran runtime error: File .pr64770test.dat. already exists" }
Note that it may be worth to run a second test to cleanup the file 'pr64770test.dat'.
Dominique