Merged with mainline at revision 126229.
[official-gcc.git] / gcc / testsuite / gcc.target / mips / save-restore-1.c
blob95689b5b618ab7dfa76ea331d9e67e7367103253
1 /* Check that we can use the save instruction to save varargs. */
2 /* { dg-mips-options "-mips32r2 -mgp32 -mips16 -O2" } */
3 #include <stdarg.h>
5 int bar (int, va_list ap);
7 int
8 foo (int n, ...)
10 va_list ap;
11 int i;
13 va_start (ap, n);
14 i = bar (n, ap);
15 va_end (ap);
16 return i + 1;
18 /* { dg-final { scan-assembler "\tsave\t\\\$4-\\\$7" } } */
19 /* { dg-final { scan-assembler "\trestore\t" } } */