Commit ee1bc59e by Jerry DeLisle

re PR libfortran/92100 (Formatted stream IO irreproducible read with binary data in file)

2019-11-24  Jerry DeLisle  <jvdelisle@gcc.ngu.org>

	PR fortran/92100
	gfortran.dg/streamio_18.f90: New test.

From-SVN: r278664
parent 8d6b4fe7
2019-11-24 Jerry DeLisle <jvdelisle@gcc.ngu.org>
PR fortran/92100
gfortran.dg/streamio_18.f90: New test.
2019-11-24 Bernd Schmidt <bernds_cb1@t-online.de> 2019-11-24 Bernd Schmidt <bernds_cb1@t-online.de>
* config/i386/i386.c (ix86_rtx_costs): Handle care of a PLUS in a * config/i386/i386.c (ix86_rtx_costs): Handle care of a PLUS in a
! { dg-do run }
! PR91200
program foo
implicit none
integer fd
open(newunit=fd, file='test.dat', access='stream', form='formatted')
write(fd,'(A)') '$MeshFormat'
write(fd,'(A)') 'aabbccdd'
close(fd)
call readfile ! Read test.dat
contains
subroutine readfile
character(len=20) buf1, buf2
integer fd, m, n
open(newunit=fd, file='test.dat', access='stream', form='formatted')
inquire(fd, pos=m)
if (m /= 1) stop 'm /= 1'
read(fd, *) buf1
read(fd, *, pos=m) buf2 ! Reread by using pos=1
close(fd, status='delete')
if (buf1 /= buf2) stop 'wrong'
end subroutine readfile
end program
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment