summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pragma-isr-trapa2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pragma-isr-trapa2.c')
-rw-r--r--gcc/testsuite/gcc.dg/pragma-isr-trapa2.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pragma-isr-trapa2.c b/gcc/testsuite/gcc.dg/pragma-isr-trapa2.c
new file mode 100644
index 000000000..a1165893b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pragma-isr-trapa2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile { target { { sh-*-* sh4*-*-* } && nonpic } } } */
+/* { dg-skip-if "FPU Required" { "sh*-*-*" } { "-m*nofpu*" } { "" } } */
+/* { dg-skip-if "FPU Required" { "sh*-*-*" } { "-m4al*" } { "" } } */
+/* { dg-options "-O -m4" } */
+
+extern void foo ();
+#pragma trapa
+void
+isr()
+{
+ foo ();
+}
+
+/* { dg-final { scan-assembler-times "rte" 1} } */
+/* No interrupt-specific saves should be needed.
+ The function call will require to load the address first into a register,
+ then use that for a jsr or jmp. It will also need to load a constant
+ address in order to load fpscr. */
+/* { dg-final { scan-assembler-times "r\[0-7\]\n" 3 } } */
+/* { dg-final { scan-assembler-not "r\[8-9\]" } } */
+/* { dg-final { scan-assembler-not "r1\[,0-3\]" } } */
+/* { dg-final { scan-assembler-not "macl" } } */
+/* fpscr needs to be saved, loaded and restored. */
+/* { dg-final { scan-assembler-times "\[^_\]fpscr" 3 } } */