filename | test/sh4/undef.s |
changeset | 233:f8333b94f503 |
next | 358:65043a8f5785 |
author | nkeynes |
date | Wed Sep 27 10:21:34 2006 +0000 (17 years ago) |
permissions | -rw-r--r-- |
last change | Add user mode/system mode switch Add undefined instruction tests |
view | annotate | diff | log | raw |
1 .section .text
2 .include "sh4/inc.s"
3 !
4 ! Test for undefined/unknown instructions. The only "official"
5 ! undefined instruction is 0xFFFD, but this tests everything
6 ! that doesn't match a known instruction pattern. Undefined
7 ! instructions are expected to raise general-illegal when not
8 ! in a delay slot, and slot-illegal when in a delay slot.
10 .global _test_undefined
11 _test_undefined:
12 start_test
14 test_undef_1: ! First the official one
15 add #1, r12
16 expect_exc 0x00000180
17 test_undef_1_pc:
18 .word 0xFFFD
19 assert_exc_caught test_undef_str_k test_undef_1_pc
21 ! Gaps in the STC range (0x0nn2)
22 test_undef_2: ! 0x52
23 add #1, r12
24 expect_exc 0x00000180
25 test_undef_2_pc:
26 .word 0x0052
27 assert_exc_caught test_undef_str_k test_undef_2_pc
29 test_undef_3: ! 0x62
30 add #1, r12
31 expect_exc 0x00000180
32 test_undef_3_pc:
33 .word 0x0062
34 assert_exc_caught test_undef_str_k test_undef_3_pc
36 test_undef_4: ! 0x72
37 add #1, r12
38 expect_exc 0x00000180
39 test_undef_4_pc:
40 .word 0x0072
41 assert_exc_caught test_undef_str_k test_undef_4_pc
43 ! Test undefined FP instructions w/ and w/o FP disable
44 test_undef_fpu_1:
45 add #1, r12
46 expect_exc 0x00000180
47 test_undef_fpu_1_pc:
48 .word 0xF0CD
49 assert_exc_caught test_undef_str_k test_undef_fpu_1_pc
51 test_undef_end:
52 end_test test_undef_str_k
54 test_undef_str_k:
55 .long test_undef_str
56 test_undef_str:
57 .string "UNDEFINED-INSTRUCTION"
.