2025-02-08 19:45:40 -08:00
|
|
|
//@ compile-flags: -Copt-level=3
|
2021-03-07 14:03:35 -05: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-29 14:11:20 +10:00
|
|
|
if i == 0 {
|
|
|
|
|
panic!();
|
|
|
|
|
}
|
2021-03-07 14:03:35 -05:00
|
|
|
i += 1;
|
|
|
|
|
}
|
|
|
|
|
}
|