2024-02-22 06:10:29 -06:00
|
|
|
//@ compile-flags: -O
|
2021-03-07 13:03:35 -06:00
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
|
|
|
// Test that LLVM can eliminate the impossible `i == 0` check.
|
|
|
|
|
|
|
|
// CHECK-LABEL: @issue_75546
|
|
|
|
#[no_mangle]
|
|
|
|
pub fn issue_75546() {
|
|
|
|
let mut i = 1u32;
|
|
|
|
while i < u32::MAX {
|
|
|
|
// CHECK-NOT: panic
|
2024-05-28 23:11:20 -05:00
|
|
|
if i == 0 {
|
|
|
|
panic!();
|
|
|
|
}
|
2021-03-07 13:03:35 -06:00
|
|
|
i += 1;
|
|
|
|
}
|
|
|
|
}
|