PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / impure_2.f08
blobb829e0825a1baa92e5724e054d4adddf5684d3f7
1 ! { dg-do compile }
2 ! { dg-options "-std=f2008" }
4 ! PR fortran/45197
5 ! Check for errors with IMPURE.
7 ! Contributed by Daniel Kraft, d@domob.eu.
9 MODULE m
10   IMPLICIT NONE
12 CONTAINS
14   IMPURE PURE SUBROUTINE foobar () ! { dg-error "must not appear both" }
16   PURE ELEMENTAL IMPURE FUNCTION xyz () ! { dg-error "must not appear both" }
18   IMPURE ELEMENTAL SUBROUTINE mysub ()
19   END SUBROUTINE mysub
21   PURE SUBROUTINE purified ()
22     CALL mysub () ! { dg-error "is not PURE" }
23   END SUBROUTINE purified
25 END MODULE m