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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [boehm-gc/] [testsuite/] [boehm-gc.c/] [trace_test.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 721 jeremybenn
/* { dg-skip-if "requires --enable-gc-debug" *-*-* } */
2
 
3
#include <stdio.h>
4
#define GC_DEBUG
5
#include "gc.h"
6
 
7
struct treenode {
8
    struct treenode *x;
9
    struct treenode *y;
10
} * root[10];
11
 
12
struct treenode * mktree(int i) {
13
  struct treenode * r = GC_MALLOC(sizeof(struct treenode));
14
  if (0 == i) return 0;
15
  if (1 == i) r = GC_MALLOC_ATOMIC(sizeof(struct treenode));
16
  r -> x = mktree(i-1);
17
  r -> y = mktree(i-1);
18
  return r;
19
}
20
 
21
int main()
22
{
23
  int i;
24
  for (i = 0; i < 10; ++i) {
25
    root[i] = mktree(12);
26
  }
27
  GC_generate_random_backtrace();
28
  GC_generate_random_backtrace();
29
  GC_generate_random_backtrace();
30
  GC_generate_random_backtrace();
31
  return 0;
32
}

powered by: WebSVN 2.1.0

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