1! { dg-do compile }
2!
3! PR 54387: [F03] Wrongly accepts non-proc result variable on the RHS of a proc-pointer assignment
4!
5! Contributed by James Van Buskirk
6
7integer function foo()
8  procedure(), pointer :: i
9  i => foo  ! { dg-error "is invalid as proc-target in procedure pointer assignment" }
10end
11
12recursive function bar() result (res)
13  integer :: res
14  procedure(), pointer :: j
15  j => bar
16end
17