Skip to content

Commit da5a532

Browse files
committed
[TRY] Completely refactor std_detect tests
+ Add `avx512pf` and `avx512er` to `cpuid.def`
1 parent a02c19a commit da5a532

File tree

6 files changed

+339
-320
lines changed

6 files changed

+339
-320
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
name: Test
4141
runs-on: ${{ matrix.target.os }}
4242
strategy:
43+
fail-fast: false
4344
matrix:
4445
profile:
4546
- dev

ci/docker/x86_64-unknown-linux-gnu-emulated/cpuid.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
00000004 00000004 => 00000000 00000000 00000000 00000000
3030
00000005 ******** => 00000040 00000040 00000003 00042120 #MONITOR/MWAIT
3131
00000006 ******** => 00000077 00000002 00000001 00000000 #Thermal and Power
32-
00000007 00000000 => 00000001 f3bfbfbf bbc05ffe 03d55130 #Extended Features
32+
00000007 00000000 => 00000001 ffbfbfbf bbc05ffe 03d55130 #Extended Features
3333
00000007 00000001 => 88ee00bf 00000002 00000000 1d29cd3e
3434
00000008 ******** => 00000000 00000000 00000000 00000000
3535
00000009 ******** => 00000000 00000000 00000000 00000000 #Direct Cache

crates/std_detect/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ rustc-dep-of-std = [
4040
"compiler_builtins",
4141
"alloc",
4242
]
43+
44+
[lints.rust]
45+
unexpected_cfgs = {level = "warn", check-cfg = ['cfg(stdarch_test_everything)'] }

crates/std_detect/src/detect/macros.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ macro_rules! features {
140140
)*
141141
}
142142

143+
#[test]
144+
#[cfg($cfg)]
145+
#[cfg(stdarch_test_everything)]
146+
fn everything_present() {
147+
$(
148+
$crate::detect::check_for($crate::detect::Feature::$feature);
149+
)*
150+
}
151+
143152
/// Each variant denotes a position in a bitset for a particular feature.
144153
///
145154
/// PLEASE: do not use this, it is an implementation detail subject

0 commit comments

Comments
 (0)