From 013a83cc0252d9cc8cce994000d7a44d8e40555b Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Mon, 26 Oct 2015 10:22:15 +0000 Subject: [PATCH] Fix race on temp file in gfortran streamio_*.f90 tests * gfortran.dg/streamio_4.f90, gfortran.dg/streamio_5.f90, * gfortran.dg/streamio_6.f90, gfortran.dg/streamio_7.f90, * gfortran.dg/streamio_10.f90, gfortran.dg/streamio_12.f90: Add suffix to the temporary filename to make it unique per testcase. From-SVN: r229315 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gfortran.dg/streamio_10.f90 | 2 +- gcc/testsuite/gfortran.dg/streamio_12.f90 | 2 +- gcc/testsuite/gfortran.dg/streamio_4.f90 | 4 ++-- gcc/testsuite/gfortran.dg/streamio_5.f90 | 4 ++-- gcc/testsuite/gfortran.dg/streamio_6.f90 | 2 +- gcc/testsuite/gfortran.dg/streamio_7.f90 | 2 +- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 45dc22ec255..c7cdd98f6dd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2015-10-26 Maxim Kuvyrkov + + * gfortran.dg/streamio_4.f90, gfortran.dg/streamio_5.f90, + * gfortran.dg/streamio_6.f90, gfortran.dg/streamio_7.f90, + * gfortran.dg/streamio_10.f90, gfortran.dg/streamio_12.f90: Add + suffix to the temporary filename to make it unique per testcase. + 2015-10-26 Richard Sandiford * gcc.dg/torture/builtin-minmax-1.c: Don't run at -O0. diff --git a/gcc/testsuite/gfortran.dg/streamio_10.f90 b/gcc/testsuite/gfortran.dg/streamio_10.f90 index b0c573e6fbe..9874405cc37 100644 --- a/gcc/testsuite/gfortran.dg/streamio_10.f90 +++ b/gcc/testsuite/gfortran.dg/streamio_10.f90 @@ -8,7 +8,7 @@ program stream_io_10 integer(kind=8) :: thepos a = (/ 1, 2, 3, 4 /) b = a - open(10, file="teststream", access="stream") + open(10, file="teststream_streamio_10", access="stream") write(10) a inquire(10, pos=thepos) if (thepos.ne.17) call abort() diff --git a/gcc/testsuite/gfortran.dg/streamio_12.f90 b/gcc/testsuite/gfortran.dg/streamio_12.f90 index 0b0d678a6e2..f90d685248b 100644 --- a/gcc/testsuite/gfortran.dg/streamio_12.f90 +++ b/gcc/testsuite/gfortran.dg/streamio_12.f90 @@ -6,7 +6,7 @@ program streamtest character(1) :: tchar integer :: i,j,k real(kind=4), dimension(100,100) :: anarray - open(10, file="teststream", access="stream", form="unformatted") + open(10, file="teststream_streamio_12", access="stream", form="unformatted") anarray = 3.14159 write(10) anarray write(10, pos=1) ! This is a way to position an unformatted file diff --git a/gcc/testsuite/gfortran.dg/streamio_4.f90 b/gcc/testsuite/gfortran.dg/streamio_4.f90 index ce638a415ad..0ed3d2ed88e 100644 --- a/gcc/testsuite/gfortran.dg/streamio_4.f90 +++ b/gcc/testsuite/gfortran.dg/streamio_4.f90 @@ -9,7 +9,7 @@ program streamtest integer :: i,j,k integer, parameter :: lines = 5231 - open(10, file="teststream", access="stream", form="formatted") + open(10, file="teststream_streamio_4", access="stream", form="formatted") do i=1,lines do j=0,9 @@ -19,7 +19,7 @@ program streamtest close(10) - open(10, file="teststream", access="stream",& + open(10, file="teststream_streamio_4", access="stream",& &form="formatted", position="append") do i=1,lines do j=0,9 diff --git a/gcc/testsuite/gfortran.dg/streamio_5.f90 b/gcc/testsuite/gfortran.dg/streamio_5.f90 index 6fdf70779c0..fe7c21ce7d5 100644 --- a/gcc/testsuite/gfortran.dg/streamio_5.f90 +++ b/gcc/testsuite/gfortran.dg/streamio_5.f90 @@ -7,7 +7,7 @@ program streamtest5 character(1) :: tchar integer :: i,j,k - open(10, file="teststream", access="stream", form="unformatted") + open(10, file="teststream_streamio_5", access="stream", form="unformatted") do i=1,1229 do j=0,9 @@ -18,7 +18,7 @@ program streamtest5 close(10) - open(10, file="teststream", access="stream", form="unformatted") + open(10, file="teststream_streamio_5", access="stream", form="unformatted") do i=1,1229 do j=0,9 diff --git a/gcc/testsuite/gfortran.dg/streamio_6.f90 b/gcc/testsuite/gfortran.dg/streamio_6.f90 index 3857667b0d7..dc208899247 100644 --- a/gcc/testsuite/gfortran.dg/streamio_6.f90 +++ b/gcc/testsuite/gfortran.dg/streamio_6.f90 @@ -15,7 +15,7 @@ program streamio_6 & 72, 81, 59, 24, 37, 43, 21, 54, 68, 31, 19, 79, 63, 41,& & 42, 12, 10, 62, 43, 9, 30, 9, 54, 35, 4, 5, 55, 3, 94 / - open(unit=15,file="teststream",access="stream",form="unformatted") + open(unit=15,file="teststream_streamio_6",access="stream",form="unformatted") do i=1,100 k = a(i) write(unit=15, pos=k) achar(k) diff --git a/gcc/testsuite/gfortran.dg/streamio_7.f90 b/gcc/testsuite/gfortran.dg/streamio_7.f90 index 7a7b2771282..4d6e4a0b680 100644 --- a/gcc/testsuite/gfortran.dg/streamio_7.f90 +++ b/gcc/testsuite/gfortran.dg/streamio_7.f90 @@ -7,7 +7,7 @@ program streamtest character(1) :: tchar integer :: i,j,k real(kind=4), dimension(100,100) :: anarray - open(10, file="teststream", access="stream", form="unformatted") + open(10, file="teststream_streamio_7", access="stream", form="unformatted") anarray = 3.14159 write(10) anarray anarray = 0.0 -- 2.30.2