| 1 |
! { dg-do run } |
| 2 |
! PR25828 Stream IO test 5, unformatted single byte |
| 3 |
! Contributed by Jerry DeLisle <[email protected]>. |
| 4 |
program streamtest5 |
| 5 |
implicit none |
| 6 |
character(1) :: lf = char(10) |
| 7 |
character(1) :: tchar |
| 8 |
integer :: i,j,k |
| 9 |
|
| 10 |
open(10, file="teststream_streamio_5", access="stream", form="unformatted") |
| 11 |
|
| 12 |
do i=1,1229 |
| 13 |
do j=0,9 |
| 14 |
write(10) j |
| 15 |
end do |
| 16 |
write(10) lf |
| 17 |
end do |
| 18 |
|
| 19 |
close(10) |
| 20 |
|
| 21 |
open(10, file="teststream_streamio_5", access="stream", form="unformatted") |
| 22 |
|
| 23 |
do i=1,1229 |
| 24 |
do j=0,9 |
| 25 |
read(10) k |
| 26 |
if (k.ne.j) STOP 1 |
| 27 |
end do |
| 28 |
read(10) tchar |
| 29 |
if (tchar.ne.lf) STOP 2 |
| 30 |
end do |
| 31 |
close(10,status="delete") |
| 32 |
end program streamtest5 |