]> git.lizzy.rs Git - rust.git/blob - src/test/ui/sse2.rs
Rollup merge of #103033 - alyssais:pkg-config, r=joshtriplett
[rust.git] / src / test / ui / sse2.rs
1 // run-pass
2
3 #![allow(stable_features)]
4 #![feature(cfg_target_feature)]
5
6 use std::env;
7
8 fn main() {
9     match env::var("TARGET") {
10         Ok(s) => {
11             // Skip this tests on i586-unknown-linux-gnu where sse2 is disabled
12             if s.contains("i586") {
13                 return
14             }
15         }
16         Err(_) => return,
17     }
18     if cfg!(any(target_arch = "x86", target_arch = "x86_64")) {
19         assert!(cfg!(target_feature = "sse2"),
20                 "SSE2 was not detected as available on an x86 platform");
21     }
22     // check a negative case too -- allowed on x86, but not enabled by default
23     assert!(cfg!(not(target_feature = "avx2")),
24             "AVX2 shouldn't be detected as available by default on any platform");
25 }