diff mbox

[libgfortran,committed] PR 64770 Segfault when trying to open existing file with status="new"

Message ID 20150125093550.25D95105@mailhost.lps.ens.fr
State New
Headers show

Commit Message

Dominique d'Humières Jan. 25, 2015, 9:35 a.m. UTC
> ... FAIL: gfortran.dg/open_new_segv.f90   -O0  execution test

This is fixed with something such as


Note that it may be worth to run a second test to cleanup the file 'pr64770test.dat'.

Dominique

Comments

Jakub Jelinek Jan. 25, 2015, 11:28 a.m. UTC | #1
On Sun, Jan 25, 2015 at 10:35:50AM +0100, Dominique Dhumieres wrote:
> > ... 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'.

That is not possible in a second test, the second test might be scheduled in
a different job, in a different directory.
So you need to solve this either in the test (call some function that
removes it), or in dg-final.

	Jakub
diff mbox

Patch

--- ../_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" }