1! { dg-do run }
2!
3! PROCEDURE POINTERS without the PROCEDURE statement
4!
5! Contributed by Janus Weil <janus@gcc.gnu.org>
6
7real function e1(x)
8  real :: x
9  e1 = x * 3.0
10end function
11
12subroutine e2(a,b)
13  real, intent(inout) :: a
14  real, intent(in) :: b
15  a = a + b
16end subroutine
17
18program proc_ptr_3
19
20real, external, pointer :: fp
21
22pointer :: sp
23interface
24  subroutine sp(a,b)
25    real, intent(inout) :: a
26    real, intent(in) :: b
27  end subroutine sp
28end interface
29
30real, external :: e1
31
32interface
33  subroutine e2(a,b)
34    real, intent(inout) :: a
35    real, intent(in) :: b
36  end subroutine e2
37end interface
38
39real :: c = 1.2
40
41fp => e1
42
43if (abs(fp(2.5)-7.5)>0.01) call abort()
44
45sp => e2
46
47call sp(c,3.4)
48
49if (abs(c-4.6)>0.01) call abort()
50
51end
52