Commit 28fe1c40 by Jerry DeLisle

re PR fortran/31201 (Too large unit number generates wrong code)

2007-05-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/31201
	* gfortran.dg/large_unit_1.f90: New.
	* gfortran.dg/large_unit_2.f90: New.
	* gfortran.dg/iostat_4.f90: New
	* gfortran.dg/bounds_check_fail_1.f90: Updated.

From-SVN: r124481
parent f96d606f
2007-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/31201
* gfortran.dg/large_unit_1.f90: New.
* gfortran.dg/large_unit_2.f90: New.
* gfortran.dg/iostat_4.f90: New
* gfortran.dg/bounds_check_fail_1.f90: Updated.
2007-05-06 Paul Thomas <pault@gcc.gnu.org> 2007-05-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31540 PR fortran/31540
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
integer x(1) integer x(1)
x(2) = x(1) ! { dg-warning "out of bounds" } x(2) = x(1) ! { dg-warning "out of bounds" }
end end
! { dg-output "out of bounds for array 'x', upper bound of dimension 1 exceeded.*at line 5" } ! { dg-output "out of bounds for array 'x', upper bound of dimension 1 exceeded." }
! { dg-do run }
! PR31201 Too large unit number generates wrong code
! This tests initialization of the IOSTAT variable
integer :: i
character(len=50) :: str
write (2_8*int(huge(0_4),kind=8)+9_8, iostat=i, iomsg=str) 555
if (i.ne.5005) call abort
if (str.ne."Unit number in I/O statement too large") call abort
end
\ No newline at end of file
! { dg-do run }
! { dg-shouldfail "Unit number in I/O statement too large" }
! PR31201 Unit number in I/O statement too large
! Test case from PR
integer(kind=8) :: k= 2_8**36 + 10
integer(kind=4) :: j= 10
logical ex,op
INQUIRE(unit=k, exist=ex,opened=op)
print *, ex, op
IF (ex) THEN
OPEN(unit=k)
INQUIRE(unit=j, opened=op)
IF (op) CALL ABORT()
ENDIF
print *, k
close(k)
end
! { dg-do run }
! PR31201 Too large unit number generates wrong code
! Test case by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
integer :: i
logical :: l
character(len=60) :: s
open(2_8*huge(0)+20_8,file="foo",iostat=i)
if (i == 0) call abort
open(2_8*huge(0)+20_8,file="foo",err=99)
call abort
99 inquire(unit=18,opened=l)
if (l) call abort
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment