2008-10-27 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / boehm-gc / tests / trace_test.c
blob870e38723a8dc4aa7dc34abe2ff5d9f7296ff8d3
1 #include <stdio.h>
2 #define GC_DEBUG
3 #include "gc.h"
5 struct treenode {
6 struct treenode *x;
7 struct treenode *y;
8 } * root[10];
10 struct treenode * mktree(int i) {
11 struct treenode * r = GC_MALLOC(sizeof(struct treenode));
12 if (0 == i) return 0;
13 if (1 == i) r = GC_MALLOC_ATOMIC(sizeof(struct treenode));
14 r -> x = mktree(i-1);
15 r -> y = mktree(i-1);
16 return r;
19 main()
21 int i;
22 for (i = 0; i < 10; ++i) {
23 root[i] = mktree(12);
25 GC_generate_random_backtrace();
26 GC_generate_random_backtrace();
27 GC_generate_random_backtrace();
28 GC_generate_random_backtrace();