about summary refs log tree commit diff
path: root/src/test/codegen/issue-75546.rs
blob: 49e4d4c7ec56da3ff0761a26b55a4a0044b68101 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// min-llvm-version: 12.0.0
// compile-flags: -O
#![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
        if i == 0 { panic!(); }
        i += 1;
    }
}