OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [boehm-gc/] [testsuite/] [boehm-gc.lib/] [staticrootstest.c] - Blame information for rev 750

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 721 jeremybenn
/* { dg-add-shlib "staticrootslib.c" } */
2
 
3
#include <stdio.h>
4
 
5
#ifndef GC_DEBUG
6
# define GC_DEBUG
7
#endif
8
 
9
#include "gc.h"
10
#include "gc_backptr.h"
11
 
12
struct treenode {
13
    struct treenode *x;
14
    struct treenode *y;
15
} * root[10];
16
 
17
static char *staticroot = 0;
18
 
19
extern struct treenode * libsrl_mktree(int i);
20
extern void * libsrl_init(void);
21
extern void * libsrl_collect (void);
22
 
23
int main(void)
24
{
25
  int i;
26
  staticroot = libsrl_init();
27
  for (i = 0; i < sizeof(struct treenode); ++i) {
28
    staticroot[i] = 0x42;
29
  }
30
  libsrl_collect();
31
  for (i = 0; i < 10; ++i) {
32
    root[i] = libsrl_mktree(12);
33
    libsrl_collect();
34
  }
35
  for (i = 0; i < sizeof(struct treenode); ++i) {
36
    if (staticroot[i] != 0x42)
37
      return -1;
38
  }
39
  for (i = 0; i < 10; ++i) {
40
    root[i] = libsrl_mktree(12);
41
    libsrl_collect();
42
  }
43
  for (i = 0; i < sizeof(struct treenode); ++i) {
44
    if (staticroot[i] != 0x42)
45
      return -1;
46
  }
47
  return 0;
48
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.