| 1 |
! { dg-do run } |
| 2 |
! { dg-options "-ffloat-store" } |
| 3 |
! PR29053 Stream IO test 9. |
| 4 |
! Contributed by Jerry DeLisle <[email protected]>. |
| 5 |
! Test case derived from that given in PR by Steve Kargl. |
| 6 |
program pr29053 |
| 7 |
implicit none |
| 8 |
real dt, t, u, a(10), b(10) |
| 9 |
integer i, place |
| 10 |
dt = 1.e-6 |
| 11 |
a = real( (/ (i, i=1, 10) /) ) |
| 12 |
b = a |
| 13 |
open(unit=11, file='a.dat', access='stream') |
| 14 |
open(unit=12, file='b.dat', access='stream') |
| 15 |
do i = 1, 10 |
| 16 |
t = i * dt |
| 17 |
write(11) t |
| 18 |
write(12) a |
| 19 |
end do |
| 20 |
rewind(11) |
| 21 |
rewind(12) |
| 22 |
do i = 1, 10 |
| 23 |
t = i * dt |
| 24 |
read(12) a |
| 25 |
if (any(a.ne.b)) STOP 1 |
| 26 |
read(11) u |
| 27 |
if (u.ne.t) STOP 2 |
| 28 |
end do |
| 29 |
close(11, status="delete") |
| 30 |
close(12, status="delete") |
| 31 |
end program pr29053 |
| 32 |
|