2 ! { dg-do compile { target i?86-*-* x86_64-*-* } }
3 ! { dg-options "-O1 -fschedule-insns" }
5 MODULE class_dummy_atom_kdtree_types
6 TYPE dummy_atom_kdtree_data
10 TYPE :: dummy_atom_kdtree_node
11 TYPE(dummy_atom_kdtree_node_private
), POINTER :: p
14 TYPE :: dummy_atom_kdtree_node_private
15 TYPE(dummy_atom_kdtree_data
) :: data
18 TYPE :: dummy_atom_kdtree
19 TYPE(dummy_atom_kdtree_node
) :: root
23 FUNCTION dummy_atom_kdtree_insert(this
, item
)
24 USE class_dummy_atom_kdtree_types
26 TYPE(dummy_atom_kdtree
), INTENT(inout
) :: this
27 TYPE(dummy_atom_kdtree_data
), INTENT(in
) :: item
29 TYPE(dummy_atom_kdtree_node
) :: parent
, current
30 INTEGER :: cmp
, level
, discriminator
32 parent
= dummy_atom_kdtree_node(null())
37 DO WHILE (ASSOCIATED( current
%p
))
38 discriminator
= MODULO(level
-1, 3) + 1
39 cmp
= dummy_atom_kdtree_data_compare(item
, current
%p
%data, discriminator
)