diff options
| author | Folkert de Vries <folkert@folkertdev.nl> | 2025-01-12 17:35:47 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2025-01-16 20:39:13 +0000 |
| commit | b5babcfac28a61f7308e02333a195ad7e4249af8 (patch) | |
| tree | e932df486d574ba6fb25a35ecc443ee9891bfa3a /library/stdarch/crates/std_detect/tests | |
| parent | a1be13aeeb56b92beccd7f40f34c9531fe35249c (diff) | |
| download | rust-b5babcfac28a61f7308e02333a195ad7e4249af8.tar.gz rust-b5babcfac28a61f7308e02333a195ad7e4249af8.zip | |
add `is_s390x_feature_detected`
Diffstat (limited to 'library/stdarch/crates/std_detect/tests')
| -rw-r--r-- | library/stdarch/crates/std_detect/tests/cpu-detection.rs | 10 | ||||
| -rw-r--r-- | library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs | 14 |
2 files changed, 21 insertions, 3 deletions
diff --git a/library/stdarch/crates/std_detect/tests/cpu-detection.rs b/library/stdarch/crates/std_detect/tests/cpu-detection.rs index 6ed612a5960..69b7075bb10 100644 --- a/library/stdarch/crates/std_detect/tests/cpu-detection.rs +++ b/library/stdarch/crates/std_detect/tests/cpu-detection.rs @@ -4,6 +4,7 @@ #![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(target_arch = "s390x", feature(stdarch_s390x_feature_detection))] #![cfg_attr( any(target_arch = "x86", target_arch = "x86_64"), feature(sha512_sm_x86, x86_amx_intrinsics, xop_target_feature) @@ -18,7 +19,8 @@ target_arch = "x86", target_arch = "x86_64", target_arch = "powerpc", - target_arch = "powerpc64" + target_arch = "powerpc64", + target_arch = "s390x", ), macro_use )] @@ -241,6 +243,12 @@ fn powerpc64_linux_or_freebsd() { } #[test] +#[cfg(all(target_arch = "s390x", target_os = "linux",))] +fn s390x_linux() { + println!("vector: {}", is_s390x_feature_detected!("vector")); +} + +#[test] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] fn x86_all() { println!("aes: {:?}", is_x86_feature_detected!("aes")); 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 9f6ef074d00..4769a5e3185 100644 --- a/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs +++ b/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs @@ -7,7 +7,8 @@ target_arch = "x86", target_arch = "x86_64", target_arch = "powerpc", - target_arch = "powerpc64" + target_arch = "powerpc64", + target_arch = "s390x", ), feature(stdarch_internal) )] @@ -15,6 +16,7 @@ #![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(target_arch = "s390x", feature(stdarch_s390x_feature_detection))] #![allow(clippy::unwrap_used, clippy::use_debug, clippy::print_stdout)] #[cfg(any( @@ -24,7 +26,8 @@ target_arch = "x86", target_arch = "x86_64", target_arch = "powerpc", - target_arch = "powerpc64" + target_arch = "powerpc64", + target_arch = "s390x", ))] #[macro_use] extern crate std_detect; @@ -61,6 +64,13 @@ fn powerpc64_linux() { } #[test] +#[cfg(all(target_arch = "s390x", target_os = "linux"))] +fn s390x_linux() { + 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() { let _ = is_x86_feature_detected!("sse"); |
