2 ! { dg-additional-sources bind_c_dts_driver.c }
4 use, intrinsic :: iso_c_binding
7 type, bind(c
) :: MYFTYPE_1
12 TYPE, BIND(C
) :: particle
13 REAL(C_DOUBLE
) :: x
,vx
14 REAL(C_DOUBLE
) :: y
,vy
15 REAL(C_DOUBLE
) :: z
,vz
19 type(myftype_1
), bind(c
, name
="myDerived") :: myDerived
22 subroutine types_test(my_particles
, num_particles
) bind(c
)
23 integer(c_int
), value
:: num_particles
24 type(particle
), dimension(num_particles
) :: my_particles
27 ! going to set the particle in the middle of the list
28 i
= num_particles
/ 2;
29 my_particles(i
)%x
= my_particles(i
)%x
+ .2d0
30 my_particles(i
)%vx
= my_particles(i
)%vx
+ .2d0
31 my_particles(i
)%y
= my_particles(i
)%y
+ .2d0
32 my_particles(i
)%vy
= my_particles(i
)%vy
+ .2d0
33 my_particles(i
)%z
= my_particles(i
)%z
+ .2d0
34 my_particles(i
)%vz
= my_particles(i
)%vz
+ .2d0
35 my_particles(i
)%m
= my_particles(i
)%m
+ .2d0
37 myDerived
%i
= myDerived
%i
+ 1
38 myDerived
%j
= myDerived
%j
+ 1
39 myDerived
%s
= myDerived
%s
+ 1.0;
40 end subroutine types_test