OSDN Git Service

2010-04-27 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / c_funloc_tests_2.f03
1 ! { dg-do compile }
2 module c_funloc_tests_2
3   use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
4   implicit none
5
6 contains
7   recursive subroutine sub0() bind(c)
8     type(c_funptr) :: my_c_funptr
9     integer :: my_local_variable
10     
11     my_c_funptr = c_funloc() ! { dg-error "Missing argument" }
12     my_c_funptr = c_funloc(sub0)
13     my_c_funptr = c_funloc(sub0, sub0) ! { dg-error "More actual than formal" }
14     my_c_funptr = c_funloc(my_local_variable) ! { dg-error "must be a procedure" }
15   end subroutine sub0
16 end module c_funloc_tests_2