2 ! { dg-options "-fdec-static -frecursive" }
4 ! Contributed by Mark Eggleston <mark.eggleston@codethink.com>
6 ! Check automatic variables can be used in equivalence statements.
7 ! Any other variables that do not explicitly have the automatic
8 ! attribute will be given the automatic attribute.
10 ! Check that variables are on the stack by incorporating the
11 ! equivalence in a recursive function.
20 function factorial(n
) result(f
)
22 integer, intent(in
) :: n
23 integer, automatic :: a
27 if (loc(a
).ne
.loc(b
)) stop 1
32 f
= a
* factorial(b
-1)