filename | test/sh4/undef.s |
changeset | 233:f8333b94f503 |
next | 358:65043a8f5785 |
author | nkeynes |
date | Wed Sep 27 10:21:34 2006 +0000 (16 years ago) |
permissions | -rw-r--r-- |
last change | Add user mode/system mode switch Add undefined instruction tests |
file | annotate | diff | log | raw |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00001.2 +++ b/test/sh4/undef.s Wed Sep 27 10:21:34 2006 +00001.3 @@ -0,0 +1,57 @@1.4 +.section .text1.5 +.include "sh4/inc.s"1.6 +!1.7 +! Test for undefined/unknown instructions. The only "official"1.8 +! undefined instruction is 0xFFFD, but this tests everything1.9 +! that doesn't match a known instruction pattern. Undefined1.10 +! instructions are expected to raise general-illegal when not1.11 +! in a delay slot, and slot-illegal when in a delay slot.1.12 +1.13 +.global _test_undefined1.14 +_test_undefined:1.15 + start_test1.16 +1.17 +test_undef_1: ! First the official one1.18 + add #1, r121.19 + expect_exc 0x000001801.20 +test_undef_1_pc:1.21 + .word 0xFFFD1.22 + assert_exc_caught test_undef_str_k test_undef_1_pc1.23 +1.24 +! Gaps in the STC range (0x0nn2)1.25 +test_undef_2: ! 0x521.26 + add #1, r121.27 + expect_exc 0x000001801.28 +test_undef_2_pc:1.29 + .word 0x00521.30 + assert_exc_caught test_undef_str_k test_undef_2_pc1.31 +1.32 +test_undef_3: ! 0x621.33 + add #1, r121.34 + expect_exc 0x000001801.35 +test_undef_3_pc:1.36 + .word 0x00621.37 + assert_exc_caught test_undef_str_k test_undef_3_pc1.38 +1.39 +test_undef_4: ! 0x721.40 + add #1, r121.41 + expect_exc 0x000001801.42 +test_undef_4_pc:1.43 + .word 0x00721.44 + assert_exc_caught test_undef_str_k test_undef_4_pc1.45 +1.46 +! Test undefined FP instructions w/ and w/o FP disable1.47 +test_undef_fpu_1:1.48 + add #1, r121.49 + expect_exc 0x000001801.50 +test_undef_fpu_1_pc:1.51 + .word 0xF0CD1.52 + assert_exc_caught test_undef_str_k test_undef_fpu_1_pc1.53 +1.54 +test_undef_end:1.55 + end_test test_undef_str_k1.56 +1.57 +test_undef_str_k:1.58 + .long test_undef_str1.59 +test_undef_str:1.60 + .string "UNDEFINED-INSTRUCTION"
.