]> git.proxmox.com Git - rustc.git/blame - src/test/mir-opt/issue_101973.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / mir-opt / issue_101973.rs
CommitLineData
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]
5pub 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)]
13pub fn inner(fields: u32) -> i64 {
14 imm8(fields).rotate_right(((fields >> 8) & 0xf) << 1) as i32 as i64
15}
16
17fn main() {
18 let val = inner(0xe32cf20f);
19 assert_eq!(val as u64, 0xfffffffff0000000);
20}