summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/save-restore-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/mips/save-restore-4.c')
-rw-r--r--gcc/testsuite/gcc.target/mips/save-restore-4.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/mips/save-restore-4.c b/gcc/testsuite/gcc.target/mips/save-restore-4.c
new file mode 100644
index 000000000..5bc5bcc3d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/save-restore-4.c
@@ -0,0 +1,14 @@
+/* Check that we can use the save instruction to save $16, $17 and $31. */
+/* { dg-options "(-mips16) isa_rev>=1 -mabi=32 -O2" } */
+/* { dg-skip-if "PR target/46610" { mips-sgi-irix6* } } */
+
+void bar (void);
+
+MIPS16 void
+foo (void)
+{
+ bar ();
+ asm volatile ("" ::: "$16", "$17");
+}
+/* { dg-final { scan-assembler "\tsave\t\[0-9\]*,\\\$16,\\\$17,\\\$31" } } */
+/* { dg-final { scan-assembler "\trestore\t\[0-9\]*,\\\$16,\\\$17,\\\$31" } } */