1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 !ERROR: The function result variable 'f1' may not have an explicit SAVE attribute
4 !ERROR: The dummy argument 'x' may not have an explicit SAVE attribute
7 !ERROR: The dummy argument 'y' may not have an explicit SAVE attribute
12 !ERROR: The entity 'f2' with an explicit SAVE attribute must be a variable, procedure pointer, or COMMON block
13 function f2(x
, y
) result(r
)
15 !ERROR: The function result variable 'r' may not have an explicit SAVE attribute
17 !ERROR: The dummy argument 'x' may not have an explicit SAVE attribute
20 !ERROR: The dummy argument 'y' may not have an explicit SAVE attribute
25 ! SAVE statement should not trigger the above errors
32 !ERROR: The dummy argument 'x' may not have an explicit SAVE attribute
33 procedure(integer), pointer, save :: x
34 !ERROR: The entity 'y' with an explicit SAVE attribute must be a variable, procedure pointer, or COMMON block
35 procedure(integer), save :: y
39 !WARNING: Explicit SAVE of 'z' is redundant due to global SAVE statement
42 procedure(integer), pointer :: x
43 !WARNING: Explicit SAVE of 'x' is redundant due to global SAVE statement
45 !WARNING: Explicit SAVE of 'y' is redundant due to global SAVE statement
53 !ERROR: No explicit type declared for 'x'
59 !ERROR: 'x' appears as a COMMON block in a SAVE statement but not in a COMMON statement
65 real :: x(n
) ! OK: save statement doesn't affect x
70 !ERROR: The automatic object 'x' may not have an explicit SAVE attribute