OSDN Git Service

2010-07-24 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / c_funloc_tests_5.f03
1 ! { dg-do compile }
2 ! Test that the arg checking for c_funloc verifies the procedures are 
3 ! C interoperable.
4 module c_funloc_tests_5
5   use, intrinsic :: iso_c_binding, only: c_funloc, c_funptr
6 contains
7   subroutine sub0() bind(c)
8     type(c_funptr) :: my_c_funptr
9
10     my_c_funptr = c_funloc(sub1) ! { dg-error "must be BIND.C." }
11
12     my_c_funptr = c_funloc(func0) ! { dg-error "must be BIND.C." }
13   end subroutine sub0
14
15   subroutine sub1() 
16   end subroutine sub1
17
18   function func0(desired_retval) 
19     use, intrinsic :: iso_c_binding, only: c_int
20     integer(c_int), value :: desired_retval
21     integer(c_int) :: func0
22     func0 = desired_retval
23   end function func0
24 end module c_funloc_tests_5
25
26