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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20070212-3.c] - Blame information for rev 711

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

Line No. Rev Author Line
1 688 jeremybenn
struct foo { int i; int j; };
2
 
3
int bar (struct foo *k, int k2, int f, int f2)
4
{
5
  int *p, *q;
6
  int res;
7
  if (f)
8
    p = &k->i;
9
  else
10
    p = &k->j;
11
  res = *p;
12
  k->i = 1;
13
  if (f2)
14
    q = p;
15
  else
16
    q = &k2;
17
  return res + *q;
18
}
19
 
20
extern void abort (void);
21
 
22
int main()
23
{
24
  struct foo k;
25
  k.i = 0;
26
  k.j = 1;
27
  if (bar (&k, 1, 1, 1) != 1)
28
    abort ();
29
  return 0;
30
}

powered by: WebSVN 2.1.0

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