]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libfortran/33985 (access="stream",form="unformatted" doesn't buffer)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Wed, 14 Nov 2007 01:22:17 +0000 (01:22 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Wed, 14 Nov 2007 01:22:17 +0000 (01:22 +0000)
2007-11-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/33985
*gfortran.dg/streamio_12.f90: New test to avoid future regression.

From-SVN: r130172

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

index 4a5a0a6a3620b1584ecad655ac3607092513664e..77eeb17f58c3e7f78ad8fd72f1c1fec372c05277 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/33985
+       *gfortran.dg/streamio_12.f90: New test to avoid future regression.
+
 2007-11-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        *gfortran.dg/list_read_7.f90: Fix test so that test file is deleted when
diff --git a/gcc/testsuite/gfortran.dg/streamio_12.f90 b/gcc/testsuite/gfortran.dg/streamio_12.f90
new file mode 100644 (file)
index 0000000..0b0d678
--- /dev/null
@@ -0,0 +1,18 @@
+! { dg-do run }
+! PR33985 Stream IO test with empty write, array writes, and reads.
+program streamtest
+  implicit none
+  character(1)   :: lf = char(10)
+  character(1)   :: tchar
+  integer        :: i,j,k
+  real(kind=4), dimension(100,100) :: anarray
+  open(10, file="teststream", access="stream", form="unformatted")
+  anarray = 3.14159
+  write(10) anarray
+  write(10, pos=1) ! This is a way to position an unformatted file
+  anarray = 0.0
+  read(10) anarray
+  anarray = abs(anarray - 3.14159)
+  if (any(anarray.gt.0.00001)) call abort()
+  close(10,status="delete")
+end program streamtest
\ No newline at end of file