30 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12MODULE test3SAVE4CONTAINS5PURE FUNCTION pf( )6 IMPLICIT NONE7 INTEGER :: pf8 INTEGER :: mc9 !OK: SAVE statement is not inherited by the function10END FUNCTION11 12PURE FUNCTION pf2( )13 IMPLICIT NONE14 SAVE15 INTEGER :: pf216 !ERROR: A pure subprogram may not have a variable with the SAVE attribute17 INTEGER :: mc18END FUNCTION19 20! This same subroutine appears in test save02.f90 where it is not an21! error due to -fno-automatic.22SUBROUTINE foo23 INTEGER, TARGET :: t24 !ERROR: An initial data target may not be a reference to an object 't' that lacks the SAVE attribute25 INTEGER, POINTER :: p => t26end27 28END MODULE29 30