Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / proc_ptr_comp_18.f90
blob4b849b64e1846129a8d1db570a255e93cda9b053
1 ! { dg-do run }
3 ! PR 41139: [4.5 Regression] a procedure pointer call as actual argument
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 PROGRAM test
9 type :: t
10 PROCEDURE(add), POINTER, nopass :: f
11 end type
12 type(t) :: o
13 logical :: g
15 o%f => add
16 g=greater(4.,o%f(1.,2.))
17 if (.not. g) call abort()
19 CONTAINS
21 REAL FUNCTION add(x,y)
22 REAL, INTENT(in) :: x,y
23 add = x+y
24 END FUNCTION add
26 LOGICAL FUNCTION greater(x,y)
27 REAL, INTENT(in) :: x, y
28 print *,"greater:",x,y
29 greater = (x > y)
30 END FUNCTION greater
32 END PROGRAM test