2017-08-28 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / sparc / struct-ret-check-2.c
blob2b815345ab9ea055d0ba638fc5845b6583404213
1 /* { dg-do run } */
2 /* { dg-options "-O -mstd-struct-return" } */
3 /* { dg-require-effective-target ilp32 } */
5 extern void abort (void);
7 struct S { int x, y, z; };
9 extern void bar (struct S *s) __attribute__ ((noinline, noclone));
11 void bar (struct S *s)
13 s->x++;
16 struct S foo (void)
18 struct S s = { 0, 2, 3 };
19 bar (&s);
20 return s;
23 int main (void)
25 struct S s = foo ();
26 if (s.x != 1)
27 abort ();
28 return 0;