2023-10-16 12:36:39 -05:00
|
|
|
// skip-filecheck
|
2023-06-08 02:18:34 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2022-09-20 05:49:32 -05:00
|
|
|
//@ compile-flags: -O -C debug-assertions=on
|
2024-04-20 06:19:34 -05:00
|
|
|
// This needs inlining followed by GVN to reproduce, so we cannot use "test-mir-pass".
|
2022-09-20 05:49:32 -05:00
|
|
|
|
|
|
|
#[inline]
|
|
|
|
pub fn imm8(x: u32) -> u32 {
|
|
|
|
let mut out = 0u32;
|
|
|
|
out |= (x >> 0) & 0xff;
|
|
|
|
out
|
|
|
|
}
|
|
|
|
|
2023-09-20 16:43:33 -05:00
|
|
|
// EMIT_MIR issue_101973.inner.GVN.diff
|
2022-09-20 05:49:32 -05:00
|
|
|
#[inline(never)]
|
|
|
|
pub fn inner(fields: u32) -> i64 {
|
|
|
|
imm8(fields).rotate_right(((fields >> 8) & 0xf) << 1) as i32 as i64
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let val = inner(0xe32cf20f);
|
|
|
|
assert_eq!(val as u64, 0xfffffffff0000000);
|
|
|
|
}
|