From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/target-feature/aarch64-neon-works.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/ui/target-feature/aarch64-neon-works.rs (limited to 'tests/ui/target-feature/aarch64-neon-works.rs') diff --git a/tests/ui/target-feature/aarch64-neon-works.rs b/tests/ui/target-feature/aarch64-neon-works.rs new file mode 100644 index 000000000..3878806fd --- /dev/null +++ b/tests/ui/target-feature/aarch64-neon-works.rs @@ -0,0 +1,23 @@ +// only-aarch64 +// run-pass +#![allow(dead_code)] +use std::arch::*; +use std::arch::aarch64::*; + +// Smoke test to verify aarch64 code that enables NEON compiles. +fn main() { + let _zero = if is_aarch64_feature_detected!("neon") { + unsafe { + let zeros = zero_vector(); + vgetq_lane_u8::<1>(zeros) + } + } else { + 0 + }; +} + + +#[target_feature(enable = "neon")] +unsafe fn zero_vector() -> uint8x16_t { + vmovq_n_u8(0) +} -- cgit v1.2.3