[gcc]
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / aggregate-ret2.c
blob16e0109ef4f800a491d034484dbb26ca27efafc8
1 /* target/36834 */
2 /* Check that, with dont_keep_aggregate_return_pointer attribute, callee
3 pops the stack for the implicit pointer arg when returning a large
4 structure in memory. */
5 /* { dg-do compile } */
6 /* { dg-require-effective-target ia32 } */
8 struct foo {
9 int a;
10 int b;
11 int c;
12 int d;
15 __attribute__ ((callee_pop_aggregate_return(1)))
16 struct foo
17 bar (void)
19 struct foo retval;
20 retval.a = 1;
21 retval.b = 2;
22 retval.c = 3;
23 retval.d = 4;
24 return retval;
27 /* { dg-final { scan-assembler "ret\[ \t\]\\\$4" } } */