OSDN Git Service

2010-05-02 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / torture / pr36373-6.c
1 /* { dg-do run } */
2 /* { dg-options "-fno-tree-sra" } */
3
4 extern void abort (void);
5 struct Foo {
6     int *p;
7 } x;
8 struct Foo __attribute__((noinline))
9 bar(int *p)
10 {
11   struct Foo f;
12   f.p = p;
13   return f;
14 }
15 void __attribute__((noinline))
16 foo()
17 {
18   *x.p = 0;
19 }
20 int main()
21 {
22   int b;
23   b = 1;
24   struct Foo g = bar (&b);
25   x = g;
26   foo();
27   if (b != 0)
28     abort ();
29   return 0;
30 }