rust/tests/codegen/issues/issue-101048.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
300 B
Rust
Raw Normal View History

// compile-flags: -O
// min-llvm-version: 16
#![crate_type = "lib"]
#[no_mangle]
pub fn all_zero(data: &[u64]) -> bool {
// CHECK-LABEL: @all_zero(
// CHECK: [[PHI:%.*]] = phi i1
// CHECK-NOT: phi i8
// CHECK-NOT: zext
data.iter().copied().fold(true, |acc, x| acc & (x == 0))
}