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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [980223.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
typedef struct { char *addr; long type; } object;
2
 
3
object bar (object blah)
4
{
5
  abort();
6
}
7
 
8
object foo (object x, object y)
9
{
10
  object z = *(object*)(x.addr);
11
  if (z.type & 64)
12
    {
13
      y = *(object*)(z.addr+sizeof(object));
14
      z = *(object*)(z.addr);
15
      if (z.type & 64)
16
        y = bar(y);
17
    }
18
  return y;
19
}
20
 
21
int nil;
22
object cons1[2] = { {(char *) &nil, 0}, {(char *) &nil, 0} };
23
object cons2[2] = { {(char *) &cons1, 64}, {(char *) &nil, 0} };
24
 
25
main()
26
{
27
  object x = {(char *) &cons2, 64};
28
  object y = {(char *) &nil, 0};
29
  object three = foo(x,y);
30
  return 0;
31
}

powered by: WebSVN 2.1.0

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