]>
Commit | Line | Data |
---|---|---|
f2b60f7d FG |
1 | // compile-flags: -O -C debug-assertions=on |
2 | // This needs inlining followed by ConstProp to reproduce, so we cannot use "unit-test". | |
3 | ||
4 | #[inline] | |
5 | pub fn imm8(x: u32) -> u32 { | |
6 | let mut out = 0u32; | |
7 | out |= (x >> 0) & 0xff; | |
8 | out | |
9 | } | |
10 | ||
11 | // EMIT_MIR issue_101973.inner.ConstProp.diff | |
12 | #[inline(never)] | |
13 | pub fn inner(fields: u32) -> i64 { | |
14 | imm8(fields).rotate_right(((fields >> 8) & 0xf) << 1) as i32 as i64 | |
15 | } | |
16 | ||
17 | fn main() { | |
18 | let val = inner(0xe32cf20f); | |
19 | assert_eq!(val as u64, 0xfffffffff0000000); | |
20 | } |