1! { dg-do run }
2!
3! PR 45521: [F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE
4!
5! Contributed by Janus Weil <janus@gcc.gnu.org>
6
7module m
8  implicit none
9  interface testIF
10    module procedure test1
11    module procedure test2
12  end interface
13contains
14  real function test1 (obj)
15    real :: obj
16    test1 = obj
17  end function
18  real function test2 (pr)
19    procedure(real) :: pr
20    test2 = pr(0.)
21  end function
22end module
23
24program test
25  use m
26  implicit none
27  intrinsic :: cos
28
29  if (testIF(2.0)/=2.0) call abort()
30  if (testIF(cos)/=1.0) call abort()
31
32end program
33
34! { dg-final { cleanup-modules "m" } }
35