]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/issue-75546.rs
Rollup merge of #87385 - Aaron1011:final-enable-semi, r=petrochenkov
[rust.git] / src / test / codegen / issue-75546.rs
1 // min-llvm-version: 12.0.0
2 // compile-flags: -O
3 #![crate_type = "lib"]
4
5 // Test that LLVM can eliminate the impossible `i == 0` check.
6
7 // CHECK-LABEL: @issue_75546
8 #[no_mangle]
9 pub fn issue_75546() {
10     let mut i = 1u32;
11     while i < u32::MAX {
12         // CHECK-NOT: panic
13         if i == 0 { panic!(); }
14         i += 1;
15     }
16 }