1 // This test implements sorting of a tree involving a mix of significant and
2 // insignificant nodes. The layout of these functions matches the layout of
3 // the tree produced by dh_view.js, when sorted by "total bytes".
7 #define F(f, parent) void* f(size_t n) { return parent(n); }
34 char access(char* p
, size_t n
)
36 for (int i
= 0; i
< 1499; i
++) {
37 for (int j
= 0; j
< n
; j
++) {
42 for (int j
= 0; j
< n
; j
++) {
53 // Call all the leaves in the above tree. The pointers we pass to access()
54 // become significant in a high-access sort and insignificant in a
55 // zero-reads-or-zero-writes sort, and vice versa.
57 p
= am(11); access(p
, 11);
58 p
= a2(10); access(p
, 10);
59 p
= a3(5); access(p
, 5);
60 p
= a3(4); access(p
, 5);
62 p
= bm(10); access(p
, 10);
63 p
= b2(9); access(p
, 9);
67 p
= cm(9); access(p
, 9);