aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/interface_27.f90
blob: 128d6a6f52af9fab6135b4eeace719ffe562578a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
! { dg-do compile }
!
! PR 40039: Procedures as actual arguments: Check intent of arguments
!
! Contributed by Janus Weil <janus@gcc.gnu.org>

module m

contains

subroutine a(x,f)
  real :: x
  interface
    real function f(y)
      real,intent(in) :: y
    end function
  end interface
  print *,f(x)
end subroutine

real function func(z)
  real,intent(inout) :: z
  func = z**2
end function

subroutine caller
  interface
    real function p(y)
      real,intent(in) :: y
    end function
  end interface
  pointer :: p

  call a(4.3,func)  ! { dg-error "INTENT mismatch in argument" }
  p => func         ! { dg-error "INTENT mismatch in argument" }
end subroutine

end module