diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/aggregate-ret1.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/aggregate-ret1.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/aggregate-ret1.c b/gcc/testsuite/gcc.target/i386/aggregate-ret1.c new file mode 100644 index 00000000000..a50606793f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/aggregate-ret1.c @@ -0,0 +1,28 @@ +/* target/36834 */ +/* Check that, with keep_aggregate_return_pointer attribute, callee does + not pop the stack for the implicit pointer arg when returning a large + structure in memory. */ +/* { dg-do compile { target i?86-*-* } } */ + +struct foo { + int a; + int b; + int c; + int d; +}; + +__attribute__ ((callee_pop_aggregate_return(0))) +struct foo +bar (void) +{ + struct foo retval; + retval.a = 1; + retval.b = 2; + retval.c = 3; + retval.d = 4; + return retval; +} + +/* { dg-final { scan-assembler-not "ret\[ \t\]\\\$4" } } */ + + |