gcc/testsuite/gcc.target/mips/save-restore-1.c
raw| 1 | /* Check that we can use the save instruction to save varargs. */ |
| 2 | /* { dg-options "(-mips16) isa_rev>=1 -mabi=32 (REQUIRES_STDLIB)" } */ |
| 3 | |
| 4 | #include <stdarg.h> |
| 5 | |
| 6 | int bar (int, va_list ap); |
| 7 | |
| 8 | MIPS16 int |
| 9 | foo (int n, ...) |
| 10 | { |
| 11 | va_list ap; |
| 12 | int i; |
| 13 | |
| 14 | va_start (ap, n); |
| 15 | i = bar (n, ap); |
| 16 | va_end (ap); |
| 17 | return i + 1; |
| 18 | } |
| 19 | /* { dg-final { scan-assembler "\tsave\t\\\$4-\\\$7" } } */ |
| 20 | /* { dg-final { scan-assembler "\trestore\t" } } */ |