use bitcoin_compat::*;
use bitcoin_imports::*;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod cpuid_tests {
use super::*;
#[traced_test]
fn basic_cpuid_sanity() {
let mut eax = 0u32;
let mut ebx = 0u32;
let mut ecx = 0u32;
let mut edx = 0u32;
getcpuid(0, 0, &mut eax, &mut ebx, &mut ecx, &mut edx);
assert!(
eax >= 1,
"unexpected max‑leaf value returned by CPUID: {:#x}",
eax
);
let vendor_bytes = [
ebx.to_le_bytes(),
edx.to_le_bytes(),
ecx.to_le_bytes(),
]
.concat();
for &b in &vendor_bytes {
assert!(
(b as char).is_ascii_graphic(),
"non‑ASCII vendor byte: 0x{b:02x}"
);
}
}
}