revision 404:c5ed3c8642a2
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 404:c5ed3c8642a2 |
parent | 403:1cf393db32f2 |
child | 405:570d93abb5b7 |
author | nkeynes |
date | Fri Sep 28 07:21:58 2007 +0000 (16 years ago) |
Add BSR tests
test/Makefile | view | annotate | diff | log | ||
test/sh4/bsr.s | view | annotate | diff | log | ||
test/sh4/testsh4.c | view | annotate | diff | log |
1.1 --- a/test/Makefile Thu Sep 20 11:24:45 2007 +00001.2 +++ b/test/Makefile Fri Sep 28 07:21:58 2007 +00001.3 @@ -73,8 +73,9 @@1.5 testsh4: crt0.so sh4/testsh4.so timer.so interrupt.so \1.6 sh4/add.so sh4/addc.so sh4/addv.so sh4/and.so sh4/andi.so \1.7 - sh4/bf.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so sh4/div0.so \1.8 - sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so sh4/mac.s \1.9 + sh4/bf.so sh4/bsr.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so \1.10 + sh4/div0.so sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so \1.11 + sh4/mac.s \1.12 sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \1.13 sh4/tas.so sh4/xtrct.so \1.14 sh4/excslot.so sh4/undef.so
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00002.2 +++ b/test/sh4/bsr.s Fri Sep 28 07:21:58 2007 +00002.3 @@ -0,0 +1,99 @@2.4 +.section .text2.5 +.include "sh4/inc.s"2.6 +!2.7 +2.8 +.global _test_bsr2.9 +_test_bsr:2.10 + start_test2.11 + mov.l r11, @-r152.12 +2.13 +test_bsr_1: ! Ordinary case2.14 + add #1, r122.15 + sts pr, r112.16 + mova test_bsr_1_fail, r02.17 + mov r0, r52.18 + xor r1, r12.19 + bsr test_bsr_1_target2.20 + add #1, r12.21 +test_bsr_1_fail:2.22 + fail test_bsr_str_k2.23 + bra test_bsr_22.24 + nop2.25 +test_bsr_1_target:2.26 + sts pr, r32.27 + cmp/eq r5,r32.28 + bf test_bsr_1_fail2.29 + mov #1, r22.30 + cmp/eq r1, r22.31 + bf test_bsr_1_fail2.32 +2.33 +test_bsr_2: ! Write PR in delay slot2.34 + add #1, r122.35 +2.36 + bsr test_bsr_2_target2.37 + lds r11, pr2.38 +test_bsr_2_fail:2.39 + fail test_bsr_str_k2.40 + bra test_bsr_32.41 + nop2.42 +test_bsr_2_target:2.43 + sts pr, r42.44 + cmp/eq r4,r112.45 + bf test_bsr_2_fail2.46 +2.47 +test_bsr_3: ! Read PR in delay slot2.48 + add #1, r122.49 +2.50 + mova test_bsr_3_fail, r02.51 + mov r0, r52.52 + bsr test_bsr_3_target2.53 + sts pr, r22.54 +test_bsr_3_fail:2.55 + fail test_bsr_str_k2.56 + bra test_bsr_42.57 +test_bsr_3_target:2.58 + cmp/eq r2, r52.59 + bf test_bsr_3_fail2.60 + sts pr, r32.61 + cmp/eq r3, r52.62 + bf test_bsr_3_fail2.63 +2.64 +test_bsr_4: ! Exception in delay slot2.65 + add #1, r122.66 +2.67 + mova test_bsr_4_fail, r02.68 + add #1, r02.69 + expect_exc 0x000001A02.70 + mova test_bsr_4_rte, r02.71 + mov r0, r112.72 +test_bsr_4_fault_pc:2.73 + bsr test_bsr_4_fail2.74 + bt test_bsr_4_rte2.75 +test_bsr_4_rte:2.76 + sts pr, r12.77 + cmp/eq r1, r112.78 + bf test_bsr_4_fail2.79 + assert_exc_caught test_bsr_str_k test_bsr_4_fault_pc2.80 + bra test_bsr_52.81 + nop2.82 +test_bsr_4_fail:2.83 + fail test_bsr_str_k2.84 +2.85 +test_bsr_5:2.86 +2.87 +test_bsr_end:2.88 + mov.l @r15+, r112.89 + end_test test_bsr_str_k2.90 +2.91 +! Branch point used for tests that should never be reached (under correct2.92 +! operation. Returns immediately, which should hit the "no exception" test2.93 +test_bsr_fail:2.94 + rts2.95 + nop2.96 +2.97 +test_bsr_str_k:2.98 + .long test_bsr_str2.99 +test_bsr_str:2.100 + .string "BSR"2.101 +2.102 +2.103 \ No newline at end of file
.