OSDN Git Service

2009-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 4 Jul 2009 04:25:20 +0000 (04:25 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 4 Jul 2009 04:25:20 +0000 (04:25 +0000)
PR fortran/40638
* gfortran.dg/unit_1.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149222 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/unit_1.f90 [new file with mode: 0644]

index 23ea945..4dd0719 100644 (file)
@@ -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 (file)
index 0000000..5233bc8
--- /dev/null
@@ -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