1! { dg-do run }
2! Test that we can write an unformatted stream file without
3! truncating.
4program main
5  character (len=10) c
6  open(10, form="unformatted", access="stream", position="rewind")
7  write (10) '1234567890abcde'
8  c = ''
9  read (10,pos=1) c
10  if (c /= '1234567890') call abort
11  c = ''
12  read (10,pos=6) c
13  if (c /= '67890abcde') call abort
14  write (10,pos=3) 'AB'
15  c = ''
16  read (10,pos=1) c
17  if (c /= '12AB567890') call abort
18  c = ''
19  read (10,pos=6) c
20  if (c /= '67890abcde') call abort
21  close (10,status="delete")
22end program main
23