| 1 |
/* target/36834 */ |
| 2 |
/* Check that, with keep_aggregate_return_pointer attribute, callee does |
| 3 |
not pop 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 } */ |
| 7 |
|
| 8 |
struct foo { |
| 9 |
int a; |
| 10 |
int b; |
| 11 |
int c; |
| 12 |
int d; |
| 13 |
}; |
| 14 |
|
| 15 |
__attribute__ ((callee_pop_aggregate_return(0))) |
| 16 |
struct foo |
| 17 |
bar (void) |
| 18 |
{ |
| 19 |
struct foo retval; |
| 20 |
retval.a = 1; |
| 21 |
retval.b = 2; |
| 22 |
retval.c = 3; |
| 23 |
retval.d = 4; |
| 24 |
return retval; |
| 25 |
} |
| 26 |
|
| 27 |
/* { dg-final { scan-assembler-not "ret\[ \t\]\\\$4" } } */ |
| 28 |
|
| 29 |
|