Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.target / mips / save-restore-2.c
blobde082d331cda9d8a5e809aa24b8494add6b393c9
1 /* Check that we can use the save instruction to save spilled arguments. */
2 /* { dg-do compile { target mips16_attribute } } */
3 /* { dg-mips-options "-mips32r2 -mabi=32 -O2" } */
4 /* { dg-add-options mips16_attribute } */
6 MIPS16 void
7 foo (int *a, int b, int c)
9 asm volatile ("" ::: "$2", "$3", "$4", "$5", "$6", "$7", "$8",
10 "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$16",
11 "$17", "$18", "$19", "$20", "$21", "$22", "$23", "$24",
12 "$25", "$30", "memory");
13 a[b] = 1;
14 a[c] = 1;
16 /* { dg-final { scan-assembler "\tsave\t\\\$4-\\\$6," } } */
17 /* { dg-final { scan-assembler "\trestore\t" } } */