]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/issue-75546.rs
Add 'library/portable-simd/' from commit '1ce1c645cf27c4acdefe6ec8a11d1f0491954a99'
[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 }