]> git.lizzy.rs Git - rust.git/blob - src/test/ui/sse2.rs
Rollup merge of #63356 - ali-raheem:issue#63183, r=KodrAus
[rust.git] / src / test / ui / sse2.rs
1 // run-pass
2 // ignore-cloudabi no std::env
3
4 #![allow(stable_features)]
5 #![feature(cfg_target_feature)]
6
7 use std::env;
8
9 fn main() {
10     match env::var("TARGET") {
11         Ok(s) => {
12             // Skip this tests on i586-unknown-linux-gnu where sse2 is disabled
13             if s.contains("i586") {
14                 return
15             }
16         }
17         Err(_) => return,
18     }
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");
22     }
23     // check a negative case too -- whitelisted 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");
26 }