]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libfortran/59419 (Failing OPEN with FILE='xxx' and IOSTAT creates the file...
authorDominique d'Humieres <dominiq@lps.ens.fr>
Sat, 11 Jan 2014 21:30:43 +0000 (22:30 +0100)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 11 Jan 2014 21:30:43 +0000 (21:30 +0000)
2014-01-11  Dominique d'Humieres  <dominiq@lps.ens.fr>

* 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

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/binding_label_tests_10_main.f03
gcc/testsuite/gfortran.dg/inquire_10.f90
gcc/testsuite/gfortran.dg/inquire_15.f90
gcc/testsuite/gfortran.dg/open_negative_unit_1.f90
gcc/testsuite/gfortran.dg/pr16597.f90

index f40d56ed2c77c16c49f37166704bc43befd51752..c95790fd828c3cbb308760c1fa004854b4fea268 100644 (file)
@@ -1,3 +1,13 @@
+2014-01-11  Dominique d'Humieres  <dominiq@lps.ens.fr>
+
+       * 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  <law@redhat.com>
 
        PR middle-end/59743
index 2a4a53ba80da4a4f25f0ce98ddea2e02fbe02b73..5216fbedf6ae68a5e9e089d14d301d29188e0b91 100644 (file)
@@ -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" } }
index 090653ecba59d193cfbc8514d36c05a6eb4c52b2..bc7d6e36b387d2ecebb48b6a65c616d46e3cd0ec 100644 (file)
@@ -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)
index e2aaf9ee17d3f710de96a30eb7de7a8fb75d510d..ae94270ca8faaa5513049e16a0dd73efa48cc3b4 100644 (file)
@@ -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
index 6446436c8855c7fc963811adb06dc0c5febc98c4..bbcf46b72a6ad59af77e8086fb80a2e6fb5d46bd 100644 (file)
@@ -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
index c29147411a810503bc3db3ecd6ff6f9b28324a59..fc191efef7c7e46a9040824f6f78e042fcb472ad 100644 (file)
@@ -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)