re PR fortran/32770 ([Meta-bug] -fdefault-integer-8 issues)
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. From-SVN: r127168
This commit is contained in:
parent
f8ff69ea9a
commit
8a8d6e0b0b
4 changed files with 21 additions and 11 deletions
|
@ -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>
|
2007-08-02 Lee Millward <lee.millward@gmail.com>
|
||||||
|
|
||||||
PR c++/30849
|
PR c++/30849
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
! corrupted.
|
! corrupted.
|
||||||
program main
|
program main
|
||||||
implicit none
|
implicit none
|
||||||
integer :: i1, i2
|
integer(kind=4) :: i1, i2
|
||||||
integer :: ios
|
integer(kind=4) :: ios
|
||||||
character(len=50) :: msg
|
character(len=50) :: msg
|
||||||
|
|
||||||
! Write out a truncated unformatted sequential file by
|
! Write out a truncated unformatted sequential file by
|
||||||
|
@ -12,7 +12,7 @@ program main
|
||||||
|
|
||||||
open (10, form="unformatted", access="stream", file="foo.dat", &
|
open (10, form="unformatted", access="stream", file="foo.dat", &
|
||||||
status="unknown")
|
status="unknown")
|
||||||
write (10) 16, 1
|
write (10) 16_4, 1_4
|
||||||
close (10, status="keep")
|
close (10, status="keep")
|
||||||
|
|
||||||
! Try to read
|
! Try to read
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! { dg-do run }
|
! { dg-do run }
|
||||||
! PR31099 Runtime error on legal code using RECL
|
! PR31099 Runtime error on legal code using RECL
|
||||||
program test
|
program test
|
||||||
integer :: a, b
|
integer(kind=4) :: a, b
|
||||||
a=1
|
a=1
|
||||||
b=2
|
b=2
|
||||||
open(10, status="scratch", form="unformatted", recl=8)
|
open(10, status="scratch", form="unformatted", recl=8)
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
! { dg-do run }
|
! { dg-do run }
|
||||||
! { dg-options "-fmax-subrecord-length=16" }
|
! { dg-options "-fmax-subrecord-length=16" }
|
||||||
! Test Intel record markers with 16-byte subrecord sizes.
|
! 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
|
program main
|
||||||
implicit none
|
implicit none
|
||||||
integer, dimension(20) :: n
|
integer(kind=4), dimension(20) :: n
|
||||||
integer, dimension(30) :: m
|
integer(kind=4), dimension(30) :: m
|
||||||
integer :: i
|
integer(kind=4) :: i
|
||||||
real :: r
|
real(kind=4) :: r
|
||||||
integer :: k
|
integer(kind=4) :: k
|
||||||
! Maximum subrecord length is 16 here, or the test will fail.
|
! Maximum subrecord length is 16 here, or the test will fail.
|
||||||
open (10, file="f10.dat", &
|
open (10, file="f10.dat", &
|
||||||
form="unformatted", access="sequential")
|
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(1:5) .ne. (/ 1, 4, 9, 16, 25 /))) call abort
|
||||||
if (any(n(6:20) .ne. 0)) call abort
|
if (any(n(6:20) .ne. 0)) call abort
|
||||||
! Append to the end of the file
|
! Append to the end of the file
|
||||||
write (10) 3.14
|
write (10) 3.14_4
|
||||||
! Test multiple backspace statements
|
! Test multiple backspace statements
|
||||||
backspace 10
|
backspace 10
|
||||||
backspace 10
|
backspace 10
|
||||||
read (10) k
|
read (10) k
|
||||||
if (k .ne. 1) call abort
|
if (k .ne. 1) call abort
|
||||||
read (10) r
|
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")
|
close (10, status="delete")
|
||||||
end program main
|
end program main
|
||||||
|
|
Loading…
Add table
Reference in a new issue