This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[4.0 PATCH]: Backport fortran testcase fixes
- From: "Kaveh R. Ghazi" <ghazi at caipclassic dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org, janis187 at us dot ibm dot com
- Date: Tue, 28 Mar 2006 21:13:50 -0500 (EST)
- Subject: [4.0 PATCH]: Backport fortran testcase fixes
This patch backports to the 4.0 branch fixes for fortran testcases
which leave behind temporary files. These pieces have been on
mainline and 4.1 for about a week or so without any problems. They
can't break the released compiler since they only touch testcases,
thus they are safe for 4.0 IMHO.
Tested via a fortran-only "make check" on sparc-sun-solaris2.10, no
regressions and the relevant temp files are no longer left behind.
Okay for 4.0?
Thanks,
--Kaveh
2006-03-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gfortran.dg/direct_io_1.f90, gfortran.dg/iostat_2.f90,
gfortran.dg/open_new.f90, gfortran.dg/open_readonly_1.f90,
gfortran.dg/pr16935.f90, gfortran.dg/pr20954.f,
gfortran.fortran-torture/execute/direct_io.f90,
gfortran.fortran-torture/execute/inquire_2.f90,
gfortran.fortran-torture/execute/inquire_4.f90,
gfortran.fortran-torture/execute/list_read_1.f90,
gfortran.fortran-torture/execute/open_replace.f90,
gfortran.fortran-torture/execute/slash_edit.f90,
gfortran.fortran-torture/execute/unopened_unit_1.f90: Delete
temporary files from testcases.
* gfortran.dg/direct_io_2.f90,
gfortran.fortran-torture/execute/inquire_1.f90,
gfortran.fortran-torture/execute/inquire_3.f90: Delete temp file.
* gfortran.dg/endfile_2.f90: Delete temp file.
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/direct_io_1.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/direct_io_1.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/direct_io_1.f90 2006-01-23 00:14:28.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/direct_io_1.f90 2006-03-28 19:04:16.367965132 -0500
@@ -28,5 +28,5 @@ program direct_io_1
n = 1
write(12, rec=n) mt, nt
write(12, rec=n+1) (p(m), m=1, nt)
- close(12)
+ close(12, status='delete')
end program
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/direct_io_2.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/direct_io_2.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/direct_io_2.f90 2006-01-23 00:14:31.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/direct_io_2.f90 2006-03-28 19:04:21.269877941 -0500
@@ -40,5 +40,6 @@
READ(7, REC = IREC) IPROG, IFILE, ITOTR, IRLGN, IRECN, IEOF,IVON21, IVON22, IVON31, IVON32, IVON33, IVON34, IVON55, IVON56
IF (IRECN .NE. IRECCK) CALL ABORT
4135 CONTINUE
+ CLOSE(7, STATUS='DELETE')
STOP
END
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/endfile_2.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/endfile_2.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/endfile_2.f90 2006-01-23 00:14:24.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/endfile_2.f90 2006-03-28 19:04:37.292548304 -0500
@@ -9,4 +9,5 @@
call abort ! should never get here
stop
0023 continue
+ close(8,status='delete')
end
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/iostat_2.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/iostat_2.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/iostat_2.f90 2006-01-23 00:14:26.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/iostat_2.f90 2006-03-28 19:04:16.368958899 -0500
@@ -4,4 +4,5 @@
close(10, status="whatever", iostat=i)
if (i == 0) call abort()
write(17,*) 'foo'
+ close(17, status="delete")
end
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/open_new.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/open_new.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/open_new.f90 2006-01-23 00:14:26.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/open_new.f90 2006-03-28 19:04:16.369632372 -0500
@@ -7,5 +7,5 @@ program main
close(nout)
open(nout, file="foo.dat", status="new",err=100)
call abort ! This should never happen
-100 continue
+100 call unlink ("foo.dat")
end program main
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/open_readonly_1.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/open_readonly_1.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/open_readonly_1.f90 2006-01-23 00:14:23.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/open_readonly_1.f90 2006-03-28 19:04:16.370277680 -0500
@@ -9,6 +9,6 @@ program prog
open (unit=10, file='PR19451.dat', action="read")
write (10,*,err=20) "Hello World"
call abort()
- 20 continue
+ 20 close (10, status='delete')
end program
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/pr16935.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/pr16935.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/pr16935.f90 2006-01-23 00:14:24.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/pr16935.f90 2006-03-28 19:04:16.370887783 -0500
@@ -4,4 +4,5 @@
program bug2
implicit none
open( 1 , file = "str_500.txt", position = "REWIND" )
+ close( 1 , status = "DELETE" )
end
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/pr20954.f egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/pr20954.f
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/pr20954.f 2006-01-23 00:14:28.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.dg/pr20954.f 2006-03-28 19:04:16.371520849 -0500
@@ -8,4 +8,5 @@
filename = 'input'
open (2,file=filename)
write (line, '(5a16)') (string(i),i=1,5)
+ close (2, status='delete')
end
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/direct_io.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/direct_io.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/direct_io.f90 2006-01-23 00:08:42.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/direct_io.f90 2006-03-28 19:04:16.372218326 -0500
@@ -13,6 +13,7 @@
CALL ABORT
ENDIF
ENDDO
+ CLOSE(10,STATUS='DELETE')
STOP
10 CONTINUE
! PRINT*,' ERR= RETURN FROM READ OR WRITE'
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_1.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_1.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_1.f90 2006-01-23 00:08:36.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_1.f90 2006-03-28 19:04:21.270795055 -0500
@@ -5,4 +5,5 @@
INQUIRE(UNIT=9,ACCESS=ACCESS,BLANK=BLANK)
IF(BLANK.NE.'NULL') CALL ABORT
IF(ACCESS.NE.'SEQUENTIAL') CALL ABORT
+ CLOSE(UNIT=9,STATUS='DELETE')
END
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_2.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_2.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_2.f90 2006-01-23 00:08:42.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_2.f90 2006-03-28 19:04:16.372869636 -0500
@@ -3,4 +3,5 @@
OPEN(FILE='CSEQ', UNIT=23)
INQUIRE(FILE='CSEQ',NUMBER=UNIT)
IF (UNIT.NE.23) CALL ABORT
+ CLOSE(UNIT, STATUS='DELETE')
END
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_3.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_3.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_3.f90 2006-01-23 00:08:37.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_3.f90 2006-03-28 19:04:21.271422841 -0500
@@ -9,5 +9,6 @@
INQUIRE(UNIT=9,NEXTREC=NREC)
IF (NREC.NE.2) CALL ABORT
! PRINT*,NREC
+ CLOSE(UNIT=9,STATUS='DELETE')
END
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_4.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_4.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_4.f90 2006-01-23 00:08:42.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/inquire_4.f90 2006-03-28 19:04:16.373504943 -0500
@@ -16,5 +16,6 @@
! PRINT*,'NEXTREC RETURNED ',J,' EXPECTED 4'
CALL ABORT
ENDIF
+ CLOSE(UNIT=10,STATUS='DELETE')
END
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/list_read_1.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/list_read_1.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/list_read_1.f90 2006-01-23 00:08:38.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/list_read_1.f90 2006-03-28 19:04:16.374171775 -0500
@@ -50,4 +50,5 @@
if (x(i,k).ne.y(i,k)) call abort
end do
end do
+ close(nin, status='delete')
end program d
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/open_replace.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/open_replace.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/open_replace.f90 2006-01-23 00:08:36.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/open_replace.f90 2006-03-28 19:04:16.374794119 -0500
@@ -2,4 +2,5 @@
! open with 'REPLACE' creates the file if it does not exist.
PROGRAM iobug
OPEN(UNIT=10,FILE='gfcoutput.txt',status='REPLACE')
+ CLOSE(10,status='DELETE')
END PROGRAM iobug
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/slash_edit.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/slash_edit.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/slash_edit.f90 2006-01-23 00:08:43.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/slash_edit.f90 2006-03-28 19:04:16.375443028 -0500
@@ -8,7 +8,7 @@
OPEN(7)
200 FORMAT(I4,///I4)
READ(7,200)I,J
- CLOSE(7)
+ CLOSE(7, STATUS='DELETE')
IF (I.NE.1) CALL ABORT
IF (J.NE.4) CALL ABORT
END
diff -rup orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/unopened_unit_1.f90 egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/unopened_unit_1.f90
--- orig/egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/unopened_unit_1.f90 2006-01-23 00:08:39.000000000 -0500
+++ egcc-4.0-SVN20060327/gcc/testsuite/gfortran.fortran-torture/execute/unopened_unit_1.f90 2006-03-28 19:04:16.376071054 -0500
@@ -9,5 +9,6 @@ program unopened_unit_1
Read(99,*)J
If (J.ne.I) Call abort
End Do
+ Close(99, Status='Delete')
End program