[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / save01.f90
blobbeffcc98cc55edf60aab0b37926e1bb4509dfb3d
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 MODULE test
4 SAVE
5 CONTAINS
6 PURE FUNCTION pf( )
7 IMPLICIT NONE
8 INTEGER :: pf
9 INTEGER :: mc
10 !OK: SAVE statement is not inherited by the function
11 END FUNCTION
13 PURE FUNCTION pf2( )
14 IMPLICIT NONE
15 SAVE
16 INTEGER :: pf2
17 !ERROR: A pure subprogram may not have a variable with the SAVE attribute
18 INTEGER :: mc
19 END FUNCTION
21 END MODULE