Skip to content

Commit 7155115

Browse files
committed
Edit macro_trailing_commas to enable tests in all architectures
1 parent b3c20b6 commit 7155115

File tree

1 file changed

+47
-18
lines changed

1 file changed

+47
-18
lines changed

crates/std_detect/tests/macro_trailing_commas.rs

+47-18
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,30 @@
99
target_arch = "powerpc",
1010
target_arch = "powerpc64",
1111
target_arch = "s390x",
12+
target_arch = "riscv32",
13+
target_arch = "riscv64",
14+
target_arch = "loongarch64"
1215
),
1316
feature(stdarch_internal)
1417
)]
1518
#![cfg_attr(target_arch = "arm", feature(stdarch_arm_feature_detection))]
16-
#![cfg_attr(target_arch = "aarch64", feature(stdarch_aarch64_feature_detection))]
17-
#![cfg_attr(target_arch = "powerpc", feature(stdarch_powerpc_feature_detection))]
18-
#![cfg_attr(target_arch = "powerpc64", feature(stdarch_powerpc_feature_detection))]
19+
#![cfg_attr(
20+
any(target_arch = "aarch64", target_arch = "arm64ec"),
21+
feature(stdarch_aarch64_feature_detection)
22+
)]
23+
#![cfg_attr(
24+
any(target_arch = "powerpc", target_arch = "powerpc64"),
25+
feature(stdarch_powerpc_feature_detection)
26+
)]
1927
#![cfg_attr(target_arch = "s390x", feature(stdarch_s390x_feature_detection))]
20-
#![allow(clippy::unwrap_used, clippy::use_debug, clippy::print_stdout)]
28+
#![cfg_attr(
29+
any(target_arch = "riscv32", target_arch = "riscv64"),
30+
feature(stdarch_riscv_feature_detection)
31+
)]
32+
#![cfg_attr(
33+
target_arch = "loongarch64",
34+
feature(stdarch_loongarch_feature_detection)
35+
)]
2136

2237
#[cfg(any(
2338
target_arch = "arm",
@@ -28,51 +43,65 @@
2843
target_arch = "powerpc",
2944
target_arch = "powerpc64",
3045
target_arch = "s390x",
46+
target_arch = "riscv32",
47+
target_arch = "riscv64",
48+
target_arch = "loongarch64"
3149
))]
3250
#[macro_use]
3351
extern crate std_detect;
3452

3553
#[test]
36-
#[cfg(all(target_arch = "arm", any(target_os = "linux", target_os = "android")))]
37-
fn arm_linux() {
54+
#[cfg(target_arch = "arm")]
55+
fn arm() {
3856
let _ = is_arm_feature_detected!("neon");
3957
let _ = is_arm_feature_detected!("neon",);
4058
}
4159

4260
#[test]
43-
#[cfg(all(
44-
target_arch = "aarch64",
45-
any(target_os = "linux", target_os = "android")
46-
))]
47-
fn aarch64_linux() {
61+
#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
62+
fn aarch64() {
4863
let _ = is_aarch64_feature_detected!("fp");
4964
let _ = is_aarch64_feature_detected!("fp",);
5065
}
5166

5267
#[test]
53-
#[cfg(all(target_arch = "powerpc", target_os = "linux"))]
54-
fn powerpc_linux() {
68+
#[cfg(target_arch = "loongarch64")]
69+
fn loongarch64() {
70+
let _ = is_loongarch_feature_detected!("lsx");
71+
let _ = is_loongarch_feature_detected!("lsx",);
72+
}
73+
74+
#[test]
75+
#[cfg(target_arch = "powerpc")]
76+
fn powerpc() {
5577
let _ = is_powerpc_feature_detected!("altivec");
5678
let _ = is_powerpc_feature_detected!("altivec",);
5779
}
5880

5981
#[test]
60-
#[cfg(all(target_arch = "powerpc64", target_os = "linux"))]
61-
fn powerpc64_linux() {
82+
#[cfg(target_arch = "powerpc64")]
83+
fn powerpc64() {
6284
let _ = is_powerpc64_feature_detected!("altivec");
6385
let _ = is_powerpc64_feature_detected!("altivec",);
6486
}
6587

6688
#[test]
67-
#[cfg(all(target_arch = "s390x", target_os = "linux"))]
68-
fn s390x_linux() {
89+
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
90+
fn riscv() {
91+
let _ = is_riscv_feature_detected!("zk");
92+
let _ = is_riscv_feature_detected!("zk",);
93+
}
94+
95+
#[test]
96+
#[cfg(target_arch = "s390x")]
97+
fn s390x() {
6998
let _ = is_s390x_feature_detected!("vector");
7099
let _ = is_s390x_feature_detected!("vector",);
71100
}
72101

73102
#[test]
74103
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
75-
fn x86_all() {
104+
fn x86() {
76105
let _ = is_x86_feature_detected!("sse");
77106
let _ = is_x86_feature_detected!("sse",);
78107
}

0 commit comments

Comments
 (0)