2 ! { dg-options "-fdec-static -fno-automatic" }
4 ! Contributed by Mark Eggleston <mark.eggleston@codethink.com>
6 ! Storage is NOT on the static unless explicitly specified using the
7 ! DEC extension "automatic". The address of the first local variable
8 ! is used to determine that storage for the automatic local variable
9 ! is different to that of a local variable with no attributes. The
10 ! contents of the local variable in suba should be overwritten by the
15 integer, parameter :: address = kind(loc(dummy))
16 integer(address) :: ad1
17 integer(address) :: ad2
18 integer(address) :: ad3
25 ok = (ad1.eq.ad3).and.(ad1.ne.ad2)
29 subroutine suba(option, addr)
30 integer, intent(in) :: option
31 integer(address), intent(out) :: addr
32 integer, automatic :: a
40 if (loc(a).ne.loc(b)) stop 2
42 ! a should've been overwritten
47 subroutine subb(dummy, addr)
48 integer, intent(in) :: dummy
49 integer(address), intent(out) :: addr
55 subroutine subc(dummy, addr)
56 integer, intent(in) :: dummy
57 integer(address), intent(out) :: addr
58 integer, automatic :: y