From 03b7860359a9bdff793419367563974db335e45e Mon Sep 17 00:00:00 2001 From: Grond Date: Mon, 22 Jun 2026 13:03:32 -0700 Subject: Check all of the appropriate bits when parsing op1 for CDP2/MCR2/MRC2 --- tests/armv7/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/armv7/mod.rs b/tests/armv7/mod.rs index 632bd3e..7fff4a8 100644 --- a/tests/armv7/mod.rs +++ b/tests/armv7/mod.rs @@ -714,6 +714,14 @@ fn test_register_shift_rotate() { test_all([0x62, 0x00, 0x01, 0xe0], "and r0, r1, r2, rrx"); } +#[test] +fn test_decode_mrc2() { + // The LSB of the last byte being set makes op1 not match any row in + // A5.7 Unconditional Instructions, but previously this was incorrectly decoded as `mrc2`. + test_invalid([0xbc, 0xec, 0xff, 0xff]); + test_armv6([0xbc, 0xec, 0xff, 0xfe], "mrc2 p12, 7, lr, c15, c12, 5"); +} + static INSTRUCTION_BYTES: [u8; 4 * 60] = [ 0x24, 0xc0, 0x9f, 0xe5, 0x00, 0xb0, 0xa0, 0xe3, -- cgit v1.1