aboutsummaryrefslogtreecommitdiff
path: root/tests/armv7
diff options
context:
space:
mode:
authorMitchell Johnson <ehntoo@ehntoo.org>2022-09-04 19:52:22 -0400
committeriximeow <git@iximeow.net>2022-09-29 15:50:31 -0700
commitd3f2505677c3a8cd40c6dbc4bf32cfe4427aab20 (patch)
tree3b0a1619a3f9f93a98e5041ec529a34b72de3491 /tests/armv7
parent9570dae514462f4a823e54de11e6dc86587de1b7 (diff)
Add some additional 32-bit thumb branch decode test cases
Diffstat (limited to 'tests/armv7')
-rw-r--r--tests/armv7/thumb.rs30
1 files changed, 28 insertions, 2 deletions
diff --git a/tests/armv7/thumb.rs b/tests/armv7/thumb.rs
index 8e1796d..33911d2 100644
--- a/tests/armv7/thumb.rs
+++ b/tests/armv7/thumb.rs
@@ -728,17 +728,39 @@ fn test_decode_bcc_cases() {
}
#[test]
fn test_decode_32b_branch_cases() {
- // encoding t4
test_display(
&[0xf3, 0xf7, 0x7c, 0xbe],
"b.w $-0xc308"
);
- // encoding t4
test_display(
&[0x0c, 0xf0, 0x84, 0xb9],
"b.w $+0xc308"
);
test_display(
+ &[0x00, 0xf4, 0x00, 0x90],
+ "b.w $-0x1000000"
+ );
+ test_display(
+ &[0xff, 0xf3, 0xff, 0x97],
+ "b.w $+0xfffffe"
+ );
+ test_display(
+ &[0x00, 0xf4, 0x00, 0xc0],
+ "blx.w $-0x1000000"
+ );
+ test_display(
+ &[0xff, 0xf3, 0xfe, 0xc7],
+ "blx.w $+0xfffffc"
+ );
+ test_display(
+ &[0x00, 0xf4, 0x00, 0xd0],
+ "bl.w $-0x1000000"
+ );
+ test_display(
+ &[0xff, 0xf3, 0xff, 0xd7],
+ "bl.w $+0xfffffe"
+ );
+ test_display(
&[0x3f, 0xf4, 0xfe, 0xaf],
"b.weq $-0x4"
);
@@ -1429,6 +1451,10 @@ fn test_decode_cmp_cases() {
&[0xff, 0x45],
"cmp pc, pc"
);
+ test_display(
+ &[0xb4, 0xeb, 0x55, 0x4f],
+ "cmp.w r4, r5, lsr 17"
+ );
}
#[test]
fn test_decode_it_cases() {