gcc/testsuite/gfortran.dg/pr119502.f90
raw| 1 | ! { dg-do run } |
| 2 | |
| 3 | ! PR119502, negative unit numbers are not allowed without using NEWUNIT |
| 4 | |
| 5 | program foo |
| 6 | integer :: iun = -1 |
| 7 | integer :: ios |
| 8 | open (iun, iostat=ios) |
| 9 | if (ios == 0) stop 1 |
| 10 | write(iun,*, iostat=ios) "This is a test." |
| 11 | if (ios == 0) stop 2 |
| 12 | close (iun, iostat=ios) |
| 13 | if (ios == 0) stop 3 |
| 14 | end |
| 15 |