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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20071018-1.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 688 jeremybenn
extern void abort(void);
2
 
3
struct foo {
4
  int rank;
5
  char *name;
6
};
7
 
8
struct mem {
9
  struct foo *x[4];
10
};
11
 
12
void __attribute__((noinline)) bar(struct foo **f)
13
{
14
  *f = __builtin_malloc(sizeof(struct foo));
15
}
16
struct foo * foo(int rank)
17
{
18
  void *x = __builtin_malloc(sizeof(struct mem));
19
  struct mem *as = x;
20
  struct foo **upper = &as->x[rank * 8 - 1];
21
  *upper = 0;
22
  bar(upper);
23
  return *upper;
24
}
25
 
26
int main()
27
{
28
  if (foo(0) == 0)
29
    abort ();
30
  return 0;
31
}

powered by: WebSVN 2.1.0

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