1! { dg-do compile }
2! PR 18197: Check that dummy functions with RESULT variable and dimension works.
3module innerfun
4contains
5  function f(n,x) result(y)
6    integer, intent(in) :: n
7    real, dimension(:), intent(in) :: x
8    real, dimension(n) :: y
9    y = 1
10  end function f
11end module innerfun
12
13module outerfun
14contains
15   subroutine foo(n,funname)
16     integer, intent(in) :: n
17     real, dimension(n) :: y
18     real, dimension(2) :: x
19     interface
20       function funname(n,x) result(y)
21         integer, intent(in) :: n
22         real, dimension(:), intent(in) :: x
23         real, dimension(n)  :: y
24       end function funname
25     end interface
26
27     y = funname(n, (/ 0.2, 0.3 /) )
28
29   end subroutine foo
30end module outerfun
31
32program test
33   use outerfun
34   use innerfun
35   call foo(3,f)
36end program test
37