[NFC][RISCV] Remove CFIIndex argument from allocateStack (#117871)
[llvm-project.git] / flang / test / Semantics / save01.f90
blob0e29113252b85ca6f5d75d46b9fc0e10c102f047
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 MODULE test
3 SAVE
4 CONTAINS
5 PURE FUNCTION pf( )
6 IMPLICIT NONE
7 INTEGER :: pf
8 INTEGER :: mc
9 !OK: SAVE statement is not inherited by the function
10 END FUNCTION
12 PURE FUNCTION pf2( )
13 IMPLICIT NONE
14 SAVE
15 INTEGER :: pf2
16 !ERROR: A pure subprogram may not have a variable with the SAVE attribute
17 INTEGER :: mc
18 END FUNCTION
20 ! This same subroutine appears in test save02.f90 where it is not an
21 ! error due to -fno-automatic.
22 SUBROUTINE foo
23 INTEGER, TARGET :: t
24 !ERROR: An initial data target may not be a reference to an object 't' that lacks the SAVE attribute
25 INTEGER, POINTER :: p => t
26 end
28 END MODULE