gcc/testsuite/gfortran.dg/pr119856.f90
raw| 1 | ! { dg-do run } |
| 2 | ! PR119856, the error should occur in both write statements. |
| 3 | program badfmt |
| 4 | implicit none |
| 5 | |
| 6 | character(10):: fmt = "(AI5)" ! Not a PARAMETER so not examined |
| 7 | ! at compile time |
| 8 | integer :: ioerr |
| 9 | ioerr = 0 |
| 10 | write (*, fmt, iostat=ioerr) 'value =', 42 |
| 11 | if (ioerr /= 5006) stop 10 |
| 12 | ! |
| 13 | write (*, fmt, iostat=ioerr) 'value =', 43 |
| 14 | if (ioerr /= 5006) stop 13 |
| 15 | end program badfmt |