aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/gfortran.dg/bounds_check_fail_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/iostat_4.f909
-rw-r--r--gcc/testsuite/gfortran.dg/large_unit_1.f9017
-rw-r--r--gcc/testsuite/gfortran.dg/large_unit_2.f9013
5 files changed, 48 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2b74f7c..36cec0d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+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>
PR fortran/31540
diff --git a/gcc/testsuite/gfortran.dg/bounds_check_fail_1.f90 b/gcc/testsuite/gfortran.dg/bounds_check_fail_1.f90
index 938d19a..8617456 100644
--- a/gcc/testsuite/gfortran.dg/bounds_check_fail_1.f90
+++ b/gcc/testsuite/gfortran.dg/bounds_check_fail_1.f90
@@ -4,4 +4,4 @@
integer x(1)
x(2) = x(1) ! { dg-warning "out of bounds" }
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." }
diff --git a/gcc/testsuite/gfortran.dg/iostat_4.f90 b/gcc/testsuite/gfortran.dg/iostat_4.f90
new file mode 100644
index 0000000..34c25f9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/iostat_4.f90
@@ -0,0 +1,9 @@
+! { 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
diff --git a/gcc/testsuite/gfortran.dg/large_unit_1.f90 b/gcc/testsuite/gfortran.dg/large_unit_1.f90
new file mode 100644
index 0000000..60e2d1f1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/large_unit_1.f90
@@ -0,0 +1,17 @@
+! { 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
diff --git a/gcc/testsuite/gfortran.dg/large_unit_2.f90 b/gcc/testsuite/gfortran.dg/large_unit_2.f90
new file mode 100644
index 0000000..5f3554c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/large_unit_2.f90
@@ -0,0 +1,13 @@
+! { 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