5 ! Test of using internal bind(C) procedures as
6 ! actual argument. Bind(c) on internal procedures and
7 ! internal procedures are actual argument are
8 ! Fortran 2008 (draft) extension.
14 subroutine test_sub(a, arg, res)
16 subroutine a(x) bind(C)
18 integer(c_int), intent(inout) :: x
21 integer(c_int), intent(inout) :: arg
22 integer(c_int), intent(in) :: res
24 if(arg /= res) call abort()
25 end subroutine test_sub
26 subroutine test_func(a, arg, res)
28 integer(c_int) function a(x) bind(C)
30 integer(c_int), intent(in) :: x
33 integer(c_int), intent(in) :: arg
34 integer(c_int), intent(in) :: res
35 if(a(arg) /= res) call abort()
36 end subroutine test_func
44 call test_sub (one, a, 7*33)
46 call test_func(two, a, -123*23)
48 subroutine one(x) bind(c)
49 integer(c_int),intent(inout) :: x
52 integer(c_int) function two(y) bind(c)
53 integer(c_int),intent(in) :: y