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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [ipa/] [ipa-pta-15.c] - Blame information for rev 701

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -fipa-pta" } */
3
 
4
struct Foo {
5
  int *p;
6
  int *q;
7
};
8
 
9
void __attribute__((noinline))
10
bar (int **x)
11
{
12
  struct Foo *f = (struct Foo *)(x - 1);
13
  *(f->p) = 0;
14
}
15
 
16
int foo(void)
17
{
18
  struct Foo f;
19
  int i = 1, j = 2;
20
  f.p = &i;
21
  f.q = &j;
22
  bar(&f.q);
23
  return i;
24
}
25
 
26
extern void abort (void);
27
int main()
28
{
29
  if (foo () != 0)
30
    abort ();
31
  return 0;
32
}

powered by: WebSVN 2.1.0

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