This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, committed] Fix three test cases for PR 32770
- From: Thomas Koenig <tkoenig at alice-dsl dot net>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 02 Aug 2007 22:58:47 +0200
- Subject: [patch, committed] Fix three test cases for PR 32770
Hello world,
I just committed the patch below. Pre-approval by FX.
Thomas
Index: ChangeLog
===================================================================
--- ChangeLog (revision 127167)
+++ ChangeLog (working copy)
@@ -1,3 +1,11 @@
+2007-08-02 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/32770
+ * gfortran.dg/unf_read_corrupted_1.f90: Make all kinds
+ explicit so test passes with -fdefault-integer-8.
+ * gfortran.dg/unformatted_recl_1.f90: Likewise.
+ * gfortran.dg/unformatted_subrecord_1.f90: Likewise.
+
2007-08-02 Lee Millward <lee.millward@gmail.com>
PR c++/30849
Index: gfortran.dg/unf_read_corrupted_1.f90
===================================================================
--- gfortran.dg/unf_read_corrupted_1.f90 (revision 127167)
+++ gfortran.dg/unf_read_corrupted_1.f90 (working copy)
@@ -3,8 +3,8 @@
! corrupted.
program main
implicit none
- integer :: i1, i2
- integer :: ios
+ integer(kind=4) :: i1, i2
+ integer(kind=4) :: ios
character(len=50) :: msg
! Write out a truncated unformatted sequential file by
@@ -12,7 +12,7 @@ program main
open (10, form="unformatted", access="stream", file="foo.dat", &
status="unknown")
- write (10) 16, 1
+ write (10) 16_4, 1_4
close (10, status="keep")
! Try to read
Index: gfortran.dg/unformatted_recl_1.f90
===================================================================
--- gfortran.dg/unformatted_recl_1.f90 (revision 127167)
+++ gfortran.dg/unformatted_recl_1.f90 (working copy)
@@ -1,7 +1,7 @@
! { dg-do run }
! PR31099 Runtime error on legal code using RECL
program test
- integer :: a, b
+ integer(kind=4) :: a, b
a=1
b=2
open(10, status="scratch", form="unformatted", recl=8)
Index: gfortran.dg/unformatted_subrecord_1.f90
===================================================================
--- gfortran.dg/unformatted_subrecord_1.f90 (revision 127167)
+++ gfortran.dg/unformatted_subrecord_1.f90 (working copy)
@@ -1,13 +1,15 @@
! { dg-do run }
! { dg-options "-fmax-subrecord-length=16" }
! Test Intel record markers with 16-byte subrecord sizes.
+! PR 32770: Use explicit kinds for all integers and constants,
+! to avoid problems with -fdefault-integer-8 and -fdefault-real-8
program main
implicit none
- integer, dimension(20) :: n
- integer, dimension(30) :: m
- integer :: i
- real :: r
- integer :: k
+ integer(kind=4), dimension(20) :: n
+ integer(kind=4), dimension(30) :: m
+ integer(kind=4) :: i
+ real(kind=4) :: r
+ integer(kind=4) :: k
! Maximum subrecord length is 16 here, or the test will fail.
open (10, file="f10.dat", &
form="unformatted", access="sequential")
@@ -33,13 +35,13 @@ program main
if (any(n(1:5) .ne. (/ 1, 4, 9, 16, 25 /))) call abort
if (any(n(6:20) .ne. 0)) call abort
! Append to the end of the file
- write (10) 3.14
+ write (10) 3.14_4
! Test multiple backspace statements
backspace 10
backspace 10
read (10) k
if (k .ne. 1) call abort
read (10) r
- if (abs(r-3.14) .gt. 1e-7) call abort
+ if (abs(r-3.14_4) .gt. 1e-7) call abort
close (10, status="delete")
end program main