* config/rx/rx.h (LABEL_ALIGN_FOR_BARRIER): Define.
[official-gcc.git] / boehm-gc / tests / staticrootstest.c
blob68ff9eaea1e31359075a422a83a4e599879f9436
1 #include <stdio.h>
3 #ifndef GC_DEBUG
4 # define GC_DEBUG
5 #endif
7 #include "gc.h"
8 #include "gc_backptr.h"
10 struct treenode {
11 struct treenode *x;
12 struct treenode *y;
13 } * root[10];
15 static char *staticroot = 0;
17 extern struct treenode * libsrl_mktree(int i);
18 extern void * libsrl_init(void);
19 extern void * libsrl_collect (void);
21 int main(void)
23 int i;
24 staticroot = libsrl_init();
25 for (i = 0; i < sizeof(struct treenode); ++i) {
26 staticroot[i] = 0x42;
28 libsrl_collect();
29 for (i = 0; i < 10; ++i) {
30 root[i] = libsrl_mktree(12);
31 libsrl_collect();
33 for (i = 0; i < sizeof(struct treenode); ++i) {
34 if (staticroot[i] != 0x42)
35 return -1;
37 for (i = 0; i < 10; ++i) {
38 root[i] = libsrl_mktree(12);
39 libsrl_collect();
41 for (i = 0; i < sizeof(struct treenode); ++i) {
42 if (staticroot[i] != 0x42)
43 return -1;
45 return 0;