| 1 |
! { dg-do run { target fd_truncate } } |
| 2 |
! PR 26499 : Positioning of EOF after backspaces and write. |
| 3 |
! This test verifies that the last write truncates the file. |
| 4 |
! Submitted by Jerry DeLisle <[email protected]>. |
| 5 |
program test |
| 6 |
integer at,eof |
| 7 |
dimension idata(5) |
| 8 |
idata = -42 |
| 9 |
open(unit=11,form='unformatted') |
| 10 |
write(11)idata |
| 11 |
write(11)idata |
| 12 |
write(11)idata |
| 13 |
backspace(11) |
| 14 |
backspace(11) |
| 15 |
write(11)idata |
| 16 |
close(11, status="keep") |
| 17 |
open(unit=11,form='unformatted') |
| 18 |
rewind(11) |
| 19 |
read(11)idata |
| 20 |
read(11)idata |
| 21 |
read(11, end=250)idata |
| 22 |
STOP 1 |
| 23 |
250 continue |
| 24 |
close(11, status="delete") |
| 25 |
end |
| 26 |
|