OSDN Git Service

2010-05-02 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / torture / pr36373-1.c
1 /* { dg-do run } */
2 /* { dg-options "-fno-tree-sra" } */
3
4 extern void abort (void);
5 struct Bar {
6     struct Foo {
7         int *p;
8     } 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   f.x = bar (&b);
30   f.q = &a;
31   foo(f.x);
32   if (b != 0)
33     abort ();
34   return 0;
35 }