diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/mips/save-restore-1.c')
-rw-r--r-- | gcc/testsuite/gcc.target/mips/save-restore-1.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/mips/save-restore-1.c b/gcc/testsuite/gcc.target/mips/save-restore-1.c new file mode 100644 index 000000000..ad92e5d75 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/save-restore-1.c @@ -0,0 +1,21 @@ +/* Check that we can use the save instruction to save varargs. */ +/* { dg-options "(-mips16) isa_rev>=1 -mabi=32 -O2" } */ +/* { dg-skip-if "PR target/46610" { mips-sgi-irix6* } } */ + +#include <stdarg.h> + +int bar (int, va_list ap); + +MIPS16 int +foo (int n, ...) +{ + va_list ap; + int i; + + va_start (ap, n); + i = bar (n, ap); + va_end (ap); + return i + 1; +} +/* { dg-final { scan-assembler "\tsave\t\\\$4-\\\$7" } } */ +/* { dg-final { scan-assembler "\trestore\t" } } */ |