| 1 |
! { dg-do run } |
| 2 |
! PR 26499 Test write with rewind sequences to make sure buffering and |
| 3 |
! end-of-file conditions are handled correctly. Derived from test case by Dale |
| 4 |
! Ranta. Submitted by Jerry DeLisle <[email protected]>. |
| 5 |
program test |
| 6 |
dimension idata(1011) |
| 7 |
idata = -42 |
| 8 |
open(unit=11,form='unformatted') |
| 9 |
idata(1) = -705 |
| 10 |
idata( 1011) = -706 |
| 11 |
write(11)idata |
| 12 |
idata(1) = -706 |
| 13 |
idata( 1011) = -707 |
| 14 |
write(11)idata |
| 15 |
idata(1) = -707 |
| 16 |
idata( 1011) = -708 |
| 17 |
write(11)idata |
| 18 |
read(11,end= 1000 )idata |
| 19 |
STOP 1 |
| 20 |
1000 continue |
| 21 |
rewind 11 |
| 22 |
read(11,end= 1001 )idata |
| 23 |
if(idata(1).ne. -705.or.idata( 1011).ne. -706)STOP 2 |
| 24 |
1001 continue |
| 25 |
close(11,status='keep') |
| 26 |
open(unit=11,form='unformatted') |
| 27 |
rewind 11 |
| 28 |
read(11)idata |
| 29 |
if(idata(1).ne.-705)then |
| 30 |
STOP 3 |
| 31 |
endif |
| 32 |
read(11)idata |
| 33 |
if(idata(1).ne.-706)then |
| 34 |
STOP 4 |
| 35 |
endif |
| 36 |
read(11)idata |
| 37 |
if(idata(1).ne.-707)then |
| 38 |
STOP 5 |
| 39 |
endif |
| 40 |
close(11,status='delete') |
| 41 |
stop |
| 42 |
end |
| 43 |
|
| 44 |
|