1! { dg-do run }
2! PR33162 INTRINSIC functions as ACTUAL argument
3! Test case adapted from PR by Jerry DeLisle <jvdelisle@gcc.gnu.org>
4module m
5implicit none
6contains
7  subroutine sub(a)
8    optional :: a
9    character(25) :: temp
10    interface
11      function a(x)
12        real(kind=8):: a
13        real(kind=8):: x
14        intent(in) :: x
15      end function a
16    end interface
17    if(present(a)) then
18      write(temp,'(f16.10)')a(4.0d0)
19      if (trim(temp) /= '   -0.6536436209') STOP 1
20    endif
21  end subroutine sub
22end module m
23
24use m
25implicit none
26intrinsic dcos
27call sub()
28call sub(dcos)
29end
30