2 // ignore-cloudabi no std::env
4 #![allow(stable_features)]
5 #![feature(cfg_target_feature)]
10 match env::var("TARGET") {
12 // Skip this tests on i586-unknown-linux-gnu where sse2 is disabled
13 if s.contains("i586") {
19 if cfg!(any(target_arch = "x86", target_arch = "x86_64")) {
20 assert!(cfg!(target_feature = "sse2"),
21 "SSE2 was not detected as available on an x86 platform");
23 // check a negative case too -- allowed on x86, but not enabled by default
24 assert!(cfg!(not(target_feature = "avx2")),
25 "AVX2 shouldn't be detected as available by default on any platform");