mirror of
https://github.com/openharmony/third_party_rust_rust.git
synced 2026-08-27 01:41:22 -04:00
6b8b1a5b67
Fixes #75978. Fixes #99960. Fixes #101048. Fixes #101082. Fixes #101814. Fixes #103132. Fixes #103327.
14 lines
300 B
Rust
14 lines
300 B
Rust
// 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))
|
|
}
|