1/* PR middle-end/51323 */
2
3extern void abort (void);
4struct S { int a, b, c; };
5int v;
6
7__attribute__((noinline, noclone)) void
8foo (int x, int y, int z)
9{
10  if (x != v || y != 0 || z != 9)
11    abort ();
12}
13
14static inline int
15baz (const struct S *p)
16{
17  return p->b;
18}
19
20__attribute__((noinline, noclone)) void
21bar (int x, struct S y)
22{
23  foo (baz (&y), 0, x);
24}
25
26int
27main ()
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}
36