gcc/testsuite/gfortran.dg/simpleif_2.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! Test fix for regression caused by |
| 3 | ! 2006-06-23 Steven G. Kargl <[email protected]> |
| 4 | ! PR fortran/27981 |
| 5 | ! * match.c (gfc_match_if): Handle errors in assignment in simple if. |
| 6 | ! |
| 7 | module read |
| 8 | integer i, j, k |
| 9 | contains |
| 10 | subroutine a |
| 11 | integer, parameter :: n = 2 |
| 12 | if (i .eq. 0) read(j,*) k |
| 13 | if (i .eq. 0) n = j ! { dg-error "Named constant 'n' in variable definition context" } |
| 14 | end subroutine a |
| 15 | end module read |