| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-std=f2008" } |
| 3 |
|
| 4 |
! PR fortran/45197 |
| 5 |
! Check for errors with IMPURE. |
| 6 |
|
| 7 |
! Contributed by Daniel Kraft, [email protected]. |
| 8 |
|
| 9 |
MODULE m |
| 10 |
IMPLICIT NONE |
| 11 |
|
| 12 |
CONTAINS |
| 13 |
|
| 14 |
IMPURE PURE SUBROUTINE foobar () ! { dg-error "must not appear both" } |
| 15 |
|
| 16 |
PURE ELEMENTAL IMPURE FUNCTION xyz () ! { dg-error "must not appear both" } |
| 17 |
|
| 18 |
IMPURE ELEMENTAL SUBROUTINE mysub () |
| 19 |
END SUBROUTINE mysub |
| 20 |
|
| 21 |
PURE SUBROUTINE purified () |
| 22 |
CALL mysub () ! { dg-error "is not PURE" } |
| 23 |
END SUBROUTINE purified |
| 24 |
|
| 25 |
END MODULE m |