Add a test to prevent x64 Inst size slipping further (#4489)

* Add a test to prevent x64 Inst size slipping further

* Enable the test for 64-bit pointers only
This commit is contained in:
Trevor Elliott
2022-07-20 17:01:33 -07:00
committed by GitHub
parent bdaaaee21e
commit 06407dd337

View File

@@ -43,6 +43,14 @@ pub struct CallInfo {
pub opcode: Opcode,
}
#[test]
#[cfg(target_pointer_width = "64")]
fn inst_size_test() {
// This test will help with unintentionally growing the size
// of the Inst enum.
assert_eq!(72, std::mem::size_of::<Inst>());
}
pub(crate) fn low32_will_sign_extend_to_64(x: u64) -> bool {
let xs = x as i64;
xs == ((xs << 32) >> 32)