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:
@@ -43,6 +43,14 @@ pub struct CallInfo {
|
|||||||
pub opcode: Opcode,
|
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 {
|
pub(crate) fn low32_will_sign_extend_to_64(x: u64) -> bool {
|
||||||
let xs = x as i64;
|
let xs = x as i64;
|
||||||
xs == ((xs << 32) >> 32)
|
xs == ((xs << 32) >> 32)
|
||||||
|
|||||||
Reference in New Issue
Block a user