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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc4/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr36373-3.c] - Blame information for rev 519

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
 
3
extern void abort (void);
4
struct Foo {
5
    int *p;
6
};
7
struct Bar {
8
    struct Foo *x;
9
    int *q;
10
};
11
struct Foo __attribute__((noinline))
12
bar(int *p)
13
{
14
  struct Foo f;
15
  f.p = p;
16
  return f;
17
}
18
void __attribute__((noinline))
19
foo(struct Foo f)
20
{
21
  *f.p = 0;
22
}
23
int main()
24
{
25
  int a, b;
26
  a = 0;
27
  b = 1;
28
  struct Bar f;
29
  struct Foo g = bar (&b);
30
  f.x = &g;
31
  f.q = &a;
32
  foo(*f.x);
33
  if (b != 0)
34
    abort ();
35
  return 0;
36
}

powered by: WebSVN 2.1.0

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