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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr36373-2.c] - Blame information for rev 801

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 "-fno-tree-sra" } */
3
 
4
extern void abort (void);
5
struct Foo {
6
    int *p;
7
};
8
struct Bar {
9
    struct Foo *x;
10
    int *q;
11
};
12
struct Foo __attribute__((noinline))
13
bar(int *p)
14
{
15
  struct Foo f;
16
  f.p = p;
17
  return f;
18
}
19
void __attribute__((noinline))
20
foo(struct Foo f)
21
{
22
  *f.p = 0;
23
}
24
int main()
25
{
26
  int a, b;
27
  a = 0;
28
  b = 1;
29
  struct Bar f;
30
  struct Foo g = bar (&b);
31
  f.x = &g;
32
  f.q = &a;
33
  foo(*f.x);
34
  if (b != 0)
35
    abort ();
36
  return 0;
37
}

powered by: WebSVN 2.1.0

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