pr 03
This commit is contained in:
parent
5b4b1ea58d
commit
cf94ecda84
@ -130,4 +130,21 @@ Operand Sizes:
|
|||||||
|
|
||||||
assert_eq!(current_info.trim(), abi_info.trim());
|
assert_eq!(current_info.trim(), abi_info.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn operand_size_matches_spec_for_all_opcodes() {
|
||||||
|
// Scan a generous numeric range and validate every decodable opcode.
|
||||||
|
// This ensures that abi::operand_size (if kept) never diverges from the
|
||||||
|
// canonical spec (OpcodeSpec::imm_bytes).
|
||||||
|
for raw in 0u16..=1023u16 {
|
||||||
|
if let Ok(op) = OpCode::try_from(raw) {
|
||||||
|
assert_eq!(
|
||||||
|
operand_size(op),
|
||||||
|
op.spec().imm_bytes as usize,
|
||||||
|
"operand_size must match spec for {:?}",
|
||||||
|
op
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user