diff options
| author | Mads Marquart <mads@marquart.dk> | 2024-09-07 14:13:02 +0200 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2024-09-14 04:25:01 +0100 |
| commit | 8a511191a0cf9290270e1a0f25bb0c26f9a56077 (patch) | |
| tree | 672e26023a2a23c47dfe6fd8f9467b0ab4ef464a /library/stdarch/crates/std_detect/tests | |
| parent | 0fb034979a007363ba3237431934a16a165765de (diff) | |
| download | rust-8a511191a0cf9290270e1a0f25bb0c26f9a56077.tar.gz rust-8a511191a0cf9290270e1a0f25bb0c26f9a56077.zip | |
Enable feature detection on all Apple/Darwin targets
Tested in the simulator and on the device I had lying around, a 1st generation iPad Mini (which isn't Aarch64, but shows that the `sysctlbyname` calls still work even there, even if they return false). `sysctlbyname` _should_ be safe to use without causing rejections from the app store, as its usage is documented in: https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics Also, the standard library will use these soon anyhow, so this shouldn't affect the situation: https://github.com/rust-lang/rust/pull/129019
Diffstat (limited to 'library/stdarch/crates/std_detect/tests')
| -rw-r--r-- | library/stdarch/crates/std_detect/tests/cpu-detection.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/stdarch/crates/std_detect/tests/cpu-detection.rs b/library/stdarch/crates/std_detect/tests/cpu-detection.rs index cecc53afa4b..53fbf6d8c1d 100644 --- a/library/stdarch/crates/std_detect/tests/cpu-detection.rs +++ b/library/stdarch/crates/std_detect/tests/cpu-detection.rs @@ -188,8 +188,8 @@ fn aarch64_bsd() { } #[test] -#[cfg(all(target_arch = "aarch64", target_os = "macos"))] -fn aarch64_macos() { +#[cfg(all(target_arch = "aarch64", target_vendor = "apple"))] +fn aarch64_darwin() { println!("asimd: {:?}", is_aarch64_feature_detected!("asimd")); println!("fp: {:?}", is_aarch64_feature_detected!("fp")); println!("fp16: {:?}", is_aarch64_feature_detected!("fp16")); |
