Test trap 2.
authorDoug Evans <dje@google.com>
Mon, 8 Jun 1998 23:08:49 +0000 (23:08 +0000)
committerDoug Evans <dje@google.com>
Mon, 8 Jun 1998 23:08:49 +0000 (23:08 +0000)
sim/testsuite/sim/m32r/trap.cgs [new file with mode: 0644]

diff --git a/sim/testsuite/sim/m32r/trap.cgs b/sim/testsuite/sim/m32r/trap.cgs
new file mode 100644 (file)
index 0000000..386fe7f
--- /dev/null
@@ -0,0 +1,30 @@
+# m32r testcase for trap #$uimm4
+# mach(): m32r m32rx
+
+       .include "testutils.inc"
+
+       start
+
+       .global trap
+trap:
+
+; Create a trap 2 handler and call it.
+
+       ld24 r0,#0x48 ; address of trap 2 handler
+       ld24 r1,#trap2_handler
+       addi r0,#-4 ; adjust for pre-increment stores
+       ld r2,@r1+
+       st r2,@+r0
+       ld r2,@r1+
+       st r2,@+r0
+       trap #2
+
+       fail
+
+trap2_ok:
+       pass
+
+       .data
+trap2_handler:
+       ld24 r0,#trap2_ok
+       jmp r0