aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2009-07-04 04:25:20 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2009-07-04 04:25:20 +0000
commitcaf271d8026c2f9a3ade32a8e670fa3be6e3892b (patch)
tree31a1b7760925738b50bc0959763dab370c1645c1 /gcc
parentb97e8a149d534e07f19af44c23882d9f09df575f (diff)
downloadgcc-caf271d8026c2f9a3ade32a8e670fa3be6e3892b.zip
gcc-caf271d8026c2f9a3ade32a8e670fa3be6e3892b.tar.gz
gcc-caf271d8026c2f9a3ade32a8e670fa3be6e3892b.tar.bz2
re PR fortran/40638 (RTE: "Unit number in I/O statement too large" -- fails with any low value)
2009-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/40638 * gfortran.dg/unit_1.f90: New test. From-SVN: r149222
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/unit_1.f9024
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 23ea945..4dd0719 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/40638
+ * gfortran.dg/unit_1.f90: New test.
+
2009-07-03 Jason Merrill <jason@redhat.com>
* g++.dg/template/pure1.C: Expect another error.
diff --git a/gcc/testsuite/gfortran.dg/unit_1.f90 b/gcc/testsuite/gfortran.dg/unit_1.f90
new file mode 100644
index 0000000..5233bc8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/unit_1.f90
@@ -0,0 +1,24 @@
+! { dg-do run }
+! PR40638 Run Time Error: Unit number in I/O statement too large
+ program main
+ integer(kind=2) :: lun, anum
+ integer(kind=1) :: looney, bin
+ lun = 12
+ anum = 5
+ looney = 42
+ bin = 23
+ open (lun, status='scratch')
+ write(lun,*) anum
+ anum = 0
+ rewind(lun)
+ read (lun, *) anum
+ if (anum.ne.5) call abort
+ open (looney, status='scratch')
+ write(looney,*)bin
+ bin = 0
+ rewind (looney)
+ read (looney,*)bin
+ if (bin.ne.23) call abort
+ close (lun)
+ close (looney)
+ end