]> git.lizzy.rs Git - rust.git/blob - tests/codegen/issue-75546.rs
Rollup merge of #107700 - jyn514:tools-builder, r=Mark-Simulacrum
[rust.git] / tests / codegen / issue-75546.rs
1 // compile-flags: -O
2 #![crate_type = "lib"]
3
4 // Test that LLVM can eliminate the impossible `i == 0` check.
5
6 // CHECK-LABEL: @issue_75546
7 #[no_mangle]
8 pub fn issue_75546() {
9     let mut i = 1u32;
10     while i < u32::MAX {
11         // CHECK-NOT: panic
12         if i == 0 { panic!(); }
13         i += 1;
14     }
15 }