1! { dg-do compile }
2!
3! PR fortran/46484
4!
5
6function g()
7  implicit none
8  integer, allocatable :: g
9  call int()
10    print *, loc(g) ! OK
11contains
12  subroutine int()
13    print *, loc(g) ! OK
14    print *, allocated(g) ! OK
15  end subroutine int
16end function
17
18implicit none
19integer, allocatable :: x
20print *, allocated(f) ! { dg-error "must be a variable" }
21print *, loc(f) ! OK
22contains
23function f()
24  integer, allocatable :: f
25  print *, loc(f) ! OK
26  print *, allocated(f) ! OK
27end function
28end
29