| 1 |
! { dg-do run } |
| 2 |
! PR40008 F2008: Add NEWUNIT= for OPEN statement |
| 3 |
! Contributed by Jerry DeLisle <[email protected]> |
| 4 |
program newunit_1 |
| 5 |
character(len=25) :: str |
| 6 |
integer(1) :: myunit, myunit2 |
| 7 |
myunit = 25 |
| 8 |
str = "bad" |
| 9 |
open(newunit=myunit, status="scratch") |
| 10 |
open(newunit = myunit2, file="newunit_1file") |
| 11 |
write(myunit,'(e24.15e2)') 1.0d0 |
| 12 |
write(myunit2,*) "abcdefghijklmnop" |
| 13 |
flush(myunit) |
| 14 |
rewind(myunit) |
| 15 |
rewind(myunit2) |
| 16 |
read(myunit2,'(a)') str |
| 17 |
if (str.ne." abcdefghijklmnop") STOP 1 |
| 18 |
close(myunit) |
| 19 |
close(myunit2, status="delete") |
| 20 |
end program newunit_1 |