From: Dominique d'Humieres Date: Sat, 11 Jan 2014 21:30:43 +0000 (+0100) Subject: re PR libfortran/59419 (Failing OPEN with FILE='xxx' and IOSTAT creates the file... X-Git-Tag: releases/gcc-4.9.0~1699 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14817bebf07bdf22f132100ae6f2f99f9522b0e7;p=thirdparty%2Fgcc.git re PR libfortran/59419 (Failing OPEN with FILE='xxx' and IOSTAT creates the file 'xxx' after revision 196783) 2014-01-11 Dominique d'Humieres * gfortran.dg/binding_label_tests_10_main.f03: Cleanup mod file. * gfortran.dg/use_only_3.f90: Likewise. * gfortran.dg/inquire_10.f90: Delete opened file. * gfortran.dg/inquire_15.f90: Likewise. * gfortran.dg/pr16597.f90: Likewise. * gfortran.dg/open_negative_unit_1.f90: Likewise + test for PR59419. From-SVN: r206557 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f40d56ed2c77..c95790fd828c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2014-01-11 Dominique d'Humieres + + * gfortran.dg/binding_label_tests_10_main.f03: Cleanup mod file. + * gfortran.dg/use_only_3.f90: Likewise. + * gfortran.dg/inquire_10.f90: Delete opened file. + * gfortran.dg/inquire_15.f90: Likewise. + * gfortran.dg/pr16597.f90: Likewise. + * gfortran.dg/open_negative_unit_1.f90: Likewise + test + for PR59419. + 2014-01-10 Jeff Law PR middle-end/59743 diff --git a/gcc/testsuite/gfortran.dg/binding_label_tests_10_main.f03 b/gcc/testsuite/gfortran.dg/binding_label_tests_10_main.f03 index 2a4a53ba80da..5216fbedf6ae 100644 --- a/gcc/testsuite/gfortran.dg/binding_label_tests_10_main.f03 +++ b/gcc/testsuite/gfortran.dg/binding_label_tests_10_main.f03 @@ -11,3 +11,4 @@ program main use binding_label_tests_10 ! { dg-error "Variable one from module binding_label_tests_10 with binding label c_one at .1. uses the same global identifier as entity at .2. from module binding_label_tests_10_main" } use binding_label_tests_10_main end program main +! { dg-final { cleanup-modules "binding_label_tests_10" } } diff --git a/gcc/testsuite/gfortran.dg/inquire_10.f90 b/gcc/testsuite/gfortran.dg/inquire_10.f90 index 090653ecba59..bc7d6e36b387 100644 --- a/gcc/testsuite/gfortran.dg/inquire_10.f90 +++ b/gcc/testsuite/gfortran.dg/inquire_10.f90 @@ -10,6 +10,8 @@ inquire(file=trim(cwd) // '/cseq',number=unit) if (unit /= 23) call abort + close(unit=23, status = 'delete') + inquire(file='foo/../cseq2',number=unit) if (unit >= 0) call abort inquire(file='cseq2',number=unit) diff --git a/gcc/testsuite/gfortran.dg/inquire_15.f90 b/gcc/testsuite/gfortran.dg/inquire_15.f90 index e2aaf9ee17d3..ae94270ca8fa 100644 --- a/gcc/testsuite/gfortran.dg/inquire_15.f90 +++ b/gcc/testsuite/gfortran.dg/inquire_15.f90 @@ -22,6 +22,7 @@ open(99,access="sequential") inquire(99, stream=str) !print *, "str=",str if (str /= "NO") goto 10 +close(99, status="delete") stop 10 close(99, status="delete") call abort diff --git a/gcc/testsuite/gfortran.dg/open_negative_unit_1.f90 b/gcc/testsuite/gfortran.dg/open_negative_unit_1.f90 index 6446436c8855..bbcf46b72a6a 100644 --- a/gcc/testsuite/gfortran.dg/open_negative_unit_1.f90 +++ b/gcc/testsuite/gfortran.dg/open_negative_unit_1.f90 @@ -6,6 +6,7 @@ program nutest implicit none + logical l integer id, ios open(newunit=id, file="foo.txt", iostat=ios) @@ -16,6 +17,14 @@ program nutest close(id, status="delete") + open(unit=10, file="foo.txt", status="old", iostat=ios) + if (ios /= 0) call abort + + close(10, status="delete") + open(-10, file="foo.txt", iostat=ios) if (ios == 0) call abort + + inquire(file="foo.txt", exist=l) + if (l) call abort end program nutest diff --git a/gcc/testsuite/gfortran.dg/pr16597.f90 b/gcc/testsuite/gfortran.dg/pr16597.f90 index c29147411a81..fc191efef7c7 100644 --- a/gcc/testsuite/gfortran.dg/pr16597.f90 +++ b/gcc/testsuite/gfortran.dg/pr16597.f90 @@ -19,7 +19,7 @@ open (UNIT=iunit,FORM='unformatted',ACCESS='direct',RECL=strlen) write (iunit, rec=1) 'ABCD' read (iunit, rec=1) string - close (iunit) + close (iunit, status = 'delete') if (string.ne.'ABCD') call abort open (UNIT=iunit,FORM='unformatted',ACCESS='direct',STATUS='scratch',RECL=strlen)