| 1 |
! { dg-do run { target fd_truncate } } |
| 2 |
! { dg-options "-std=gnu" } |
| 3 |
! Test case prepared by Jerry DeLisle <[email protected]> |
| 4 |
real :: a(4), b(4) |
| 5 |
real :: c |
| 6 |
integer :: istat, j |
| 7 |
character(25) :: msg |
| 8 |
|
| 9 |
a = 23.45 |
| 10 |
b = 0.0 |
| 11 |
open(10, file='mydata_f2003_io_1', asynchronous="yes", blank="null") |
| 12 |
|
| 13 |
write(10,'(10f8.3)', asynchronous="yes", decimal="comma", id=j) a |
| 14 |
rewind(10) |
| 15 |
read(10,'(10f8.3)', asynchronous="yes", decimal="comma", blank="zero") b |
| 16 |
wait(10) |
| 17 |
if (any(b.ne.23.45)) STOP 1 |
| 18 |
|
| 19 |
c = 3.14 |
| 20 |
write(msg, *, decimal="comma") c |
| 21 |
if (msg(1:7).ne." 3,14") STOP 2 |
| 22 |
|
| 23 |
b = 0.0 |
| 24 |
rewind(10) |
| 25 |
write(10,'(10f8.3)', asynchronous="yes", decimal="point") a |
| 26 |
rewind(10) |
| 27 |
read(10,'(10f8.3)', asynchronous="yes", decimal="point") b |
| 28 |
wait (10) |
| 29 |
if (any(b.ne.23.45)) STOP 3 |
| 30 |
|
| 31 |
wait(unit=10, err=25, iostat=istat, iomsg=msg, end=35, id=j) |
| 32 |
|
| 33 |
! do some stuff with a |
| 34 |
25 continue |
| 35 |
|
| 36 |
35 continue |
| 37 |
|
| 38 |
close(10, status="delete") |
| 39 |
end |