+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
! 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
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
! { 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")
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