Search
lxdream.org :: lxdream/test/sh4/undef.s :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/undef.s
changeset 233:f8333b94f503
next358:65043a8f5785
author nkeynes
date Wed Sep 27 10:21:34 2006 +0000 (14 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 +0000
1.2 +++ b/test/sh4/undef.s Wed Sep 27 10:21:34 2006 +0000
1.3 @@ -0,0 +1,57 @@
1.4 +.section .text
1.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 everything
1.9 +! that doesn't match a known instruction pattern. Undefined
1.10 +! instructions are expected to raise general-illegal when not
1.11 +! in a delay slot, and slot-illegal when in a delay slot.
1.12 +
1.13 +.global _test_undefined
1.14 +_test_undefined:
1.15 + start_test
1.16 +
1.17 +test_undef_1: ! First the official one
1.18 + add #1, r12
1.19 + expect_exc 0x00000180
1.20 +test_undef_1_pc:
1.21 + .word 0xFFFD
1.22 + assert_exc_caught test_undef_str_k test_undef_1_pc
1.23 +
1.24 +! Gaps in the STC range (0x0nn2)
1.25 +test_undef_2: ! 0x52
1.26 + add #1, r12
1.27 + expect_exc 0x00000180
1.28 +test_undef_2_pc:
1.29 + .word 0x0052
1.30 + assert_exc_caught test_undef_str_k test_undef_2_pc
1.31 +
1.32 +test_undef_3: ! 0x62
1.33 + add #1, r12
1.34 + expect_exc 0x00000180
1.35 +test_undef_3_pc:
1.36 + .word 0x0062
1.37 + assert_exc_caught test_undef_str_k test_undef_3_pc
1.38 +
1.39 +test_undef_4: ! 0x72
1.40 + add #1, r12
1.41 + expect_exc 0x00000180
1.42 +test_undef_4_pc:
1.43 + .word 0x0072
1.44 + assert_exc_caught test_undef_str_k test_undef_4_pc
1.45 +
1.46 +! Test undefined FP instructions w/ and w/o FP disable
1.47 +test_undef_fpu_1:
1.48 + add #1, r12
1.49 + expect_exc 0x00000180
1.50 +test_undef_fpu_1_pc:
1.51 + .word 0xF0CD
1.52 + assert_exc_caught test_undef_str_k test_undef_fpu_1_pc
1.53 +
1.54 +test_undef_end:
1.55 + end_test test_undef_str_k
1.56 +
1.57 +test_undef_str_k:
1.58 + .long test_undef_str
1.59 +test_undef_str:
1.60 + .string "UNDEFINED-INSTRUCTION"
.