2 ! { dg-additional-sources proc_ptr_7.c }
5 ! Procedure pointer test
7 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
9 program proc_pointer_test
10 use iso_c_binding, only: c_int
16 procedure(Integer(c_int)), pointer :: f
20 procedure(Integer(c_int)), pointer :: ptr
23 if(ptr() /= 42) call abort()
26 if(ptr() /= 55) call abort()
29 if(ptr() /= 65) call abort()
34 procedure(integer(c_int)), pointer :: a
35 if(a() /= 55) call abort()
37 if(a() /= 65) call abort()
40 integer(c_int) function f55()
44 integer(c_int) function f65()
47 end program proc_pointer_test