diff options
| author | sayantn <sayantn05@gmail.com> | 2025-05-05 01:02:40 +0530 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2025-05-06 16:10:50 +0000 |
| commit | 949fd567f3737e6f5a8c0ec440247d623bf4e0a6 (patch) | |
| tree | 955023a1b068b1f5118c2d13a0e610d109377abe /library/stdarch/crates/std_detect/tests | |
| parent | f88c990b89e392c5f8289b0d1cfb5641e8aabaab (diff) | |
| download | rust-949fd567f3737e6f5a8c0ec440247d623bf4e0a6.tar.gz rust-949fd567f3737e6f5a8c0ec440247d623bf4e0a6.zip | |
Edit `macro_trailing_commas` to enable tests in all architectures
Diffstat (limited to 'library/stdarch/crates/std_detect/tests')
| -rw-r--r-- | library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs | 65 |
1 files changed, 47 insertions, 18 deletions
diff --git a/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs b/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs index 4769a5e3185..fa3a23c7968 100644 --- a/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs +++ b/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs @@ -9,15 +9,30 @@ target_arch = "powerpc", target_arch = "powerpc64", target_arch = "s390x", + target_arch = "riscv32", + target_arch = "riscv64", + target_arch = "loongarch64" ), feature(stdarch_internal) )] #![cfg_attr(target_arch = "arm", feature(stdarch_arm_feature_detection))] -#![cfg_attr(target_arch = "aarch64", feature(stdarch_aarch64_feature_detection))] -#![cfg_attr(target_arch = "powerpc", feature(stdarch_powerpc_feature_detection))] -#![cfg_attr(target_arch = "powerpc64", feature(stdarch_powerpc_feature_detection))] +#![cfg_attr( + any(target_arch = "aarch64", target_arch = "arm64ec"), + feature(stdarch_aarch64_feature_detection) +)] +#![cfg_attr( + any(target_arch = "powerpc", target_arch = "powerpc64"), + feature(stdarch_powerpc_feature_detection) +)] #![cfg_attr(target_arch = "s390x", feature(stdarch_s390x_feature_detection))] -#![allow(clippy::unwrap_used, clippy::use_debug, clippy::print_stdout)] +#![cfg_attr( + any(target_arch = "riscv32", target_arch = "riscv64"), + feature(stdarch_riscv_feature_detection) +)] +#![cfg_attr( + target_arch = "loongarch64", + feature(stdarch_loongarch_feature_detection) +)] #[cfg(any( target_arch = "arm", @@ -28,51 +43,65 @@ target_arch = "powerpc", target_arch = "powerpc64", target_arch = "s390x", + target_arch = "riscv32", + target_arch = "riscv64", + target_arch = "loongarch64" ))] #[macro_use] extern crate std_detect; #[test] -#[cfg(all(target_arch = "arm", any(target_os = "linux", target_os = "android")))] -fn arm_linux() { +#[cfg(target_arch = "arm")] +fn arm() { let _ = is_arm_feature_detected!("neon"); let _ = is_arm_feature_detected!("neon",); } #[test] -#[cfg(all( - target_arch = "aarch64", - any(target_os = "linux", target_os = "android") -))] -fn aarch64_linux() { +#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))] +fn aarch64() { let _ = is_aarch64_feature_detected!("fp"); let _ = is_aarch64_feature_detected!("fp",); } #[test] -#[cfg(all(target_arch = "powerpc", target_os = "linux"))] -fn powerpc_linux() { +#[cfg(target_arch = "loongarch64")] +fn loongarch64() { + let _ = is_loongarch_feature_detected!("lsx"); + let _ = is_loongarch_feature_detected!("lsx",); +} + +#[test] +#[cfg(target_arch = "powerpc")] +fn powerpc() { let _ = is_powerpc_feature_detected!("altivec"); let _ = is_powerpc_feature_detected!("altivec",); } #[test] -#[cfg(all(target_arch = "powerpc64", target_os = "linux"))] -fn powerpc64_linux() { +#[cfg(target_arch = "powerpc64")] +fn powerpc64() { let _ = is_powerpc64_feature_detected!("altivec"); let _ = is_powerpc64_feature_detected!("altivec",); } #[test] -#[cfg(all(target_arch = "s390x", target_os = "linux"))] -fn s390x_linux() { +#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] +fn riscv() { + let _ = is_riscv_feature_detected!("zk"); + let _ = is_riscv_feature_detected!("zk",); +} + +#[test] +#[cfg(target_arch = "s390x")] +fn s390x() { let _ = is_s390x_feature_detected!("vector"); let _ = is_s390x_feature_detected!("vector",); } #[test] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] -fn x86_all() { +fn x86() { let _ = is_x86_feature_detected!("sse"); let _ = is_x86_feature_detected!("sse",); } |
