mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
13 lines
277 B
Rust
13 lines
277 B
Rust
|
//@ compile-flags: -O
|
||
|
|
||
|
#![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))
|
||
|
}
|