1! { dg-do compile }
2!
3! PR 41733: Proc-pointer conformance checks: Elemental-proc-ptr => non-elemental-procedure
4!
5! Contributed by James Van Buskirk
6
7module funcs
8   implicit none
9   abstract interface
10      real elemental function fun(x)
11         real, intent(in) :: x
12      end function
13   end interface
14contains
15  function my_dcos(x)
16    real, intent(in) :: x
17    real :: my_dcos
18    my_dcos = cos(x)
19  end function
20end module
21
22program start
23   use funcs
24   implicit none
25   procedure(fun), pointer :: f ! { dg-error "Procedure pointer 'f' at .1. shall not be elemental" }
26   real x(3)
27   x = [1,2,3]
28   f => my_dcos     ! { dg-error "Mismatch in PURE attribute" }
29   write(*,*) f(x)
30end program start
31