Rebase.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr49651.c
blobc58fe943c83103bca0d8cbd5e0d285fc75bce872
1 /* { dg-do run } */
3 extern void abort (void);
5 struct X {
6 int *p;
7 int *q;
8 };
10 void __attribute__((noinline, noclone))
11 foo (struct X x) { *x.q = 0; }
13 volatile int what;
14 struct X y;
16 int main()
18 int i, j;
19 struct X x, *p;
20 x.p = &i;
21 x.q = &j;
22 if (what)
23 p = &y;
24 else
25 p = &x;
26 j = 1;
27 foo (*p);
28 if (j != 0)
29 abort ();
30 return 0;