2 ! Test argument checking for C_LOC with subcomponent parameters.
6 type double_vector_item
7 real(kind(1.d0)), allocatable :: v(:)
8 end type double_vector_item
9 type(double_vector_item), allocatable, target :: dbv_pool(:)
10 real(kind(1.d0)), allocatable, target :: vv(:)
16 type(foo), pointer :: v => null()
18 type(foo_item), allocatable :: foo_pool(:)
21 type(foo), pointer :: v(:) => null()
23 type(foo_item2), allocatable :: foo_pool2(:)
28 type(c_ptr) function get_double_vector_address(handle)
29 integer(c_int), intent(in) :: handle
31 if (.true.) then ! The ultimate component is an allocatable target
32 get_double_vector_address = c_loc(dbv_pool(handle)%v)
34 get_double_vector_address = c_loc(vv)
37 end function get_double_vector_address
40 type(c_ptr) function get_foo_address(handle)
41 integer(c_int), intent(in) :: handle
42 get_foo_address = c_loc(foo_pool(handle)%v)
44 get_foo_address = c_loc(foo_pool2(handle)%v) ! { dg-error "must be a scalar" }
45 end function get_foo_address
48 end module c_vhandle_mod