std_detect: Move aarch64 freebsd test to tests/cpu-detection.rs

This commit is contained in:
Taiki Endo 2023-01-26 00:27:21 +09:00 committed by Amanieu d'Antras
parent e706a13add
commit 674fd58f60
2 changed files with 20 additions and 18 deletions

View file

@ -1,21 +1,3 @@
//! Run-time feature detection for Aarch64 on FreeBSD.
pub(crate) use super::super::aarch64::detect_features;
#[cfg(test)]
mod tests {
#[test]
fn dump() {
println!("asimd: {:?}", is_aarch64_feature_detected!("asimd"));
println!("pmull: {:?}", is_aarch64_feature_detected!("pmull"));
println!("fp: {:?}", is_aarch64_feature_detected!("fp"));
println!("fp16: {:?}", is_aarch64_feature_detected!("fp16"));
println!("sve: {:?}", is_aarch64_feature_detected!("sve"));
println!("crc: {:?}", is_aarch64_feature_detected!("crc"));
println!("lse: {:?}", is_aarch64_feature_detected!("lse"));
println!("rdm: {:?}", is_aarch64_feature_detected!("rdm"));
println!("rcpc: {:?}", is_aarch64_feature_detected!("rcpc"));
println!("dotprod: {:?}", is_aarch64_feature_detected!("dotprod"));
println!("tme: {:?}", is_aarch64_feature_detected!("tme"));
}
}

View file

@ -97,6 +97,26 @@ fn aarch64_windows() {
println!("sha2: {:?}", is_aarch64_feature_detected!("sha2"));
}
#[test]
#[cfg(all(target_arch = "aarch64", target_os = "freebsd"))]
fn aarch64_freebsd() {
println!("asimd: {:?}", is_aarch64_feature_detected!("asimd"));
println!("pmull: {:?}", is_aarch64_feature_detected!("pmull"));
println!("fp: {:?}", is_aarch64_feature_detected!("fp"));
println!("fp16: {:?}", is_aarch64_feature_detected!("fp16"));
println!("sve: {:?}", is_aarch64_feature_detected!("sve"));
println!("crc: {:?}", is_aarch64_feature_detected!("crc"));
println!("lse: {:?}", is_aarch64_feature_detected!("lse"));
println!("rdm: {:?}", is_aarch64_feature_detected!("rdm"));
println!("rcpc: {:?}", is_aarch64_feature_detected!("rcpc"));
println!("dotprod: {:?}", is_aarch64_feature_detected!("dotprod"));
println!("tme: {:?}", is_aarch64_feature_detected!("tme"));
println!("paca: {:?}", is_aarch64_feature_detected!("paca"));
println!("pacg: {:?}", is_aarch64_feature_detected!("pacg"));
println!("aes: {:?}", is_aarch64_feature_detected!("aes"));
println!("sha2: {:?}", is_aarch64_feature_detected!("sha2"));
}
#[test]
#[cfg(all(target_arch = "powerpc", target_os = "linux"))]
fn powerpc_linux() {