1program main
2  implicit none
3  real, dimension (:), pointer :: x
4  x => null ()
5  x => test (x)
6  if (.not. associated (x)) STOP 1
7  if (size (x) .ne. 10) STOP 2
8contains
9  function test (p)
10    real, dimension (:), pointer :: p, test
11    if (associated (p)) STOP 3
12    allocate (test (10))
13    if (associated (p)) STOP 4
14  end function test
15end program main
16