2 ! { dg-additional-sources bind_c_dts_2_driver.c }
4 use, intrinsic :: iso_c_binding
7 type, bind(c) :: my_c_type_0
9 type(c_ptr) :: nested_c_address
10 integer(c_int) :: array(3)
13 type, bind(c) :: my_c_type_1
14 type(my_c_type_0) :: my_nested_type
15 type(c_ptr) :: c_address
20 subroutine sub0(my_type, expected_i, expected_nested_c_address, &
21 expected_array_1, expected_array_2, expected_array_3, &
22 expected_c_address, expected_j) bind(c)
23 type(my_c_type_1) :: my_type
24 integer(c_int), value :: expected_i
25 type(c_ptr), value :: expected_nested_c_address
26 integer(c_int), value :: expected_array_1
27 integer(c_int), value :: expected_array_2
28 integer(c_int), value :: expected_array_3
29 type(c_ptr), value :: expected_c_address
30 integer(c_int), value :: expected_j
32 if (my_type%my_nested_type%i .ne. expected_i) then
36 if (.not. c_associated(my_type%my_nested_type%nested_c_address, &
37 expected_nested_c_address)) then
41 if (my_type%my_nested_type%array(1) .ne. expected_array_1) then
45 if (my_type%my_nested_type%array(2) .ne. expected_array_2) then
49 if (my_type%my_nested_type%array(3) .ne. expected_array_3) then
53 if (.not. c_associated(my_type%c_address, expected_c_address)) then
57 if (my_type%j .ne. expected_j) then
61 end module bind_c_dts_2