OSDN Git Service

PR middle-end/51323
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / pr51323.c
1 /* PR middle-end/51323 */
2
3 extern void abort (void);
4 struct S { int a, b, c; };
5 int v;
6
7 __attribute__((noinline, noclone)) void
8 foo (int x, int y, int z)
9 {
10   if (x != v || y != 0 || z != 9)
11     abort ();
12 }
13
14 static inline int
15 baz (const struct S *p)
16 {
17   return p->b;
18 }
19
20 __attribute__((noinline, noclone)) void
21 bar (int x, struct S y)
22 {
23   foo (baz (&y), 0, x);
24 }
25
26 int
27 main ()
28 {
29   struct S s;
30   v = 3; s.a = v - 1; s.b = v; s.c = v + 1;
31   bar (9, s);
32   v = 17; s.a = v - 1; s.b = v; s.c = v + 1;
33   bar (9, s);
34   return 0;
35 }