1! { dg-do compile }
2!
3! PR 40039: Procedures as actual arguments: Check intent of arguments
4!
5! Contributed by Janus Weil <janus@gcc.gnu.org>
6
7module m
8
9contains
10
11subroutine a(x,f)
12  real :: x
13  interface
14    real function f(y)
15      real,intent(in) :: y
16    end function
17  end interface
18  print *,f(x)
19end subroutine
20
21real function func(z)
22  real,intent(inout) :: z
23  func = z**2
24end function
25
26subroutine caller
27  interface
28    real function p(y)
29      real,intent(in) :: y
30    end function
31  end interface
32  pointer :: p
33
34  call a(4.3,func)  ! { dg-error "INTENT mismatch in argument" }
35  p => func         ! { dg-error "INTENT mismatch in argument" }
36end subroutine
37
38end module
39