aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2026-07-26 07:40:17 +0000
committeriximeow <me@iximeow.net>2026-07-28 07:28:15 +0000
commitb9384b6b6bcdc50efa9df73cd840eb8a49cda7ab (patch)
tree5ac3f9dfe10a453e9142ed3f0517898e219e12af /tests
parente56c1b9c84ae86b6bee7e813fa547975b3fa4532 (diff)
untangle some nonconforming ld/st forms
Diffstat (limited to 'tests')
-rw-r--r--tests/armv7/mod.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/armv7/mod.rs b/tests/armv7/mod.rs
index 7caaaf5..b5d5d17 100644
--- a/tests/armv7/mod.rs
+++ b/tests/armv7/mod.rs
@@ -100,7 +100,7 @@ fn test_arm_security_extensions(data: [u8; 4], expected: &'static str) {
fn test_nonconformant(data: [u8; 4]) {
let mut reader = yaxpeax_arch::U8Reader::new(&data[..]);
- let result = InstDecoder::default().decode(&mut reader);
+ let result = InstDecoder::default().allow_nonconforming(false).decode(&mut reader);
assert!(
result == Err(DecodeError::Nonconforming),
"got bad result: {:?} from {:#x?}", result, data
@@ -241,22 +241,23 @@ fn test_decode_str_ldr() {
test_all([0xbb, 0x38, 0xf5, 0xe1], "ldrh r3, [r5, 0x8b]!");
test_armv5([0xdb, 0x40, 0xa6, 0xe1], "ldrd r4, r5, [r6, fp]!");
test_armv5_nonconforming([0xd0, 0x10, 0x00, 0x00], "ldrdeq r1, r2, [r0], -r0");
-// TODO: bits 8..11 are "should be 0", so this decodes only when admitting nonconforming
+ // bits 8..11 are "should be 0", so this decodes only when admitting nonconforming
test_armv5_nonconforming([0xdb, 0x48, 0xa6, 0xe1], "ldrd r4, r5, [r6, fp]!");
test_armv5_nonconforming([0xdb, 0x38, 0xa5, 0xe1], "ldrd r3, r4, [r5, fp]!");
- test_invalid([0xdb, 0x30, 0xa5, 0xe1]);
- test_invalid([0xfb, 0x30, 0xe5, 0xe1]);
+ test_armv5_nonconforming([0xdb, 0x30, 0xa5, 0xe1], "ldrd r3, r4, [r5, fp]!");
+ test_armv5_nonconforming([0xfb, 0x30, 0xe5, 0xe1], "strd r3, r4, [r5, 0xb]!");
test_all([0xdb, 0x30, 0xb5, 0xe1], "ldrsb r3, [r5, fp]!");
- test_all([0xdb, 0x38, 0xb5, 0xe1], "ldrsb r3, [r5, fp]!");
+ test_armv5_nonconforming([0xdb, 0x38, 0xb5, 0xe1], "ldrsb r3, [r5, fp]!");
test_armv5([0xdb, 0x48, 0xe6, 0xe1], "ldrd r4, r5, [r6, 0x8b]!");
- test_invalid([0xdb, 0x38, 0xe5, 0xe1]);
+ test_armv5_nonconforming([0xdb, 0x38, 0xe5, 0xe1], "ldrd r3, r4, [r5, 0x8b]!");
test_all([0xdb, 0x38, 0xf5, 0xe1], "ldrsb r3, [r5, 0x8b]!");
test_all([0xfb, 0x40, 0xa6, 0xe1], "strd r4, r5, [r6, fp]!");
-// TODO: bits 8..11 are "should be 0", so this decodes only when admitting nonconforming
+ // bits 8..11 are "should be 0", so this decodes only when admitting nonconforming
test_all_nonconforming([0xfb, 0x48, 0xa6, 0xe1], "strd r4, r5, [r6, fp]!");
test_all_nonconforming([0xfb, 0x38, 0xa5, 0xe1], "strd r3, r4, [r5, fp]!");
- test_all([0xfb, 0x38, 0xb5, 0xe1], "ldrsh r3, [r5, fp]!");
- test_invalid([0xfb, 0x38, 0xe5, 0xe1]);
+ test_all_nonconforming([0xfb, 0x38, 0xb5, 0xe1], "ldrsh r3, [r5, fp]!");
+ test_all([0xfb, 0x30, 0xb5, 0xe1], "ldrsh r3, [r5, fp]!");
+ test_all_nonconforming([0xfb, 0x38, 0xe5, 0xe1], "strd r3, r4, [r5, 0x8b]!");
test_all([0xfb, 0x48, 0xe6, 0xe1], "strd r4, r5, [r6, 0x8b]!");
test_all([0xfb, 0x38, 0xf5, 0xe1], "ldrsh r3, [r5, 0x8b]!");
test_all([0xfb, 0x38, 0xff, 0xe1], "ldrsh r3, [pc, 0x8b]!");