Skip to content

Commit 7d6415c

Browse files
Test NEON compiles
Required by #95002
1 parent 990c297 commit 7d6415c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// only-aarch64
2+
// run-pass
3+
use std::arch::aarch64::*;
4+
5+
// Smoke test to verify aarch64 code that enables NEON compiles.
6+
fn main() {
7+
let zero = if is_aarch64_feature_detected!("neon") {
8+
unsafe {
9+
let zeros = zero_vector();
10+
vget_lane_u8::<1>(1)
11+
}
12+
} else {
13+
0
14+
};
15+
if cfg!(target feature = "neon") {
16+
assert_eq!(zero, 0)
17+
};
18+
}
19+
20+
21+
#[target_feature(enable = "neon")]
22+
unsafe fn zero_vector() -> uint8x16_t {
23+
vmovq_n_u8(0)
24+
}

0 commit comments

Comments
 (0)