re PR libfortran/24489 (read_block wrong execution order)
authorJerry DeLisle <jvdelisle@verizon.net>
Mon, 24 Oct 2005 03:50:15 +0000 (03:50 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Mon, 24 Oct 2005 03:50:15 +0000 (03:50 +0000)
2005-10-23  Jerry DeLisle  <jvdelisle@verizon.net>

        PR libgfortran/24489
        * gfortran.dg/pr24489.f90: New test.

From-SVN: r105839

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

index 57c5b589c0f246eb8a9e11ae19806eb5c9310bdf..7e0e29a54b744861b7cf93f2aaaac2a0186cc213 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-23  Jerry DeLisle  <jvdelisle@verizon.net>
+
+        PR libgfortran/24489
+        * gfortran.dg/pr24489.f90: New test.
+
 2005-10-23  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR fortran/23635
diff --git a/gcc/testsuite/gfortran.dg/pr24489.f90 b/gcc/testsuite/gfortran.dg/pr24489.f90
new file mode 100644 (file)
index 0000000..f332755
--- /dev/null
@@ -0,0 +1,14 @@
+! { dg-do run }
+! PR24489 Assure that read does not go past the end of record. The width of
+! the format specifier is 8, but the internal unit record length is 4 so only
+! the first 4 characters should be read.
+! Contributed by Jerry DeLisle <jvdelisle@verizon.net>.
+program pr24489
+  character*4, dimension(8) :: abuf = (/"0123","4567","89AB","CDEF", &
+                                        "0123","4567","89AB","CDEF"/)
+  character*4, dimension(2,4) :: buf
+  character*8 :: a
+  equivalence (buf,abuf)
+  read(buf, '(a8)') a
+  if (a.ne.'0123') call abort()
+end program pr24489