! { dg-do run }! { dg-options "-O2 -std=f2008" }! PR fortran/100218 - target of pointer from evaluation of function-referenceprogram p
implicit noneinteger, target :: z =0callg(f())if(z /=1)stop1containsfunctionf()result(r)integer,pointer:: r
r => z
end function f
subroutineg(x)integer,intent(out) :: x
x =1end subroutine g
end program p