This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, libfortran] PR35132 Formatted stream I/O write should truncate
- From: Thomas Koenig <tkoenig at netcologne dot de>
- To: Jerry DeLisle <jvdelisle at verizon dot net>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 10 Feb 2008 21:31:16 +0100
- Subject: Re: [patch, libfortran] PR35132 Formatted stream I/O write should truncate
- References: <47AE5599.9060201@verizon.net> <1202672257.31770.1.camel@meiner.onlinehome.de>
I just committed the attached test case as obvious (after
verifying that it passes :-).
Thomas
! { dg-do run }
! Test that we can write an unformatted stream file without
! truncating.
program main
character (len=10) c
open(10, form="unformatted", access="stream", position="rewind")
write (10) '1234567890abcde'
c = ''
read (10,pos=1) c
if (c /= '1234567890') call abort
c = ''
read (10,pos=6) c
if (c /= '67890abcde') call abort
write (10,pos=3) 'AB'
c = ''
read (10,pos=1) c
if (c /= '12AB567890') call abort
c = ''
read (10,pos=6) c
if (c /= '67890abcde') call abort
close (10,status="delete")
end program main