1 ! { dg-do run { target fd_truncate } }
2 ! PR 34370 - file positioning after non-advancing I/O didn't add
8 character(len
=80), parameter :: fname
= "advance_backspace_1.dat"
18 if (c
/= 'ab ') call abort
37 if (c
/= 'ab ') call abort
45 if (c
/= 'ab ') call abort
52 open(95, file
=fname
, status
="replace", form
="formatted")
53 write (95, '(A)', advance
="no") 'a'
54 write (95, '(A)', advance
="no") 'b'
55 end subroutine write_file
57 ! Checks for correct end record, then deletes the file.
59 subroutine check_end_record
61 open(2003, file
=fname
, status
="old", access
="stream", form
="unformatted")
63 if (x
/= 'a') call abort
65 if (x
/= 'b') call abort
67 if (x
/= achar(10)) then
69 if (x
/= achar(13)) then
74 close(2003,status
="delete")
75 end subroutine check_end_record