]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/sse2.rs
Enable target_feature on any LLVM 6+
[rust.git] / src / test / run-pass / sse2.rs
index 22469b2fde058180210fd9e58efd4c6b87809b6b..b1d7e5435c4cb9b33d905aa3b78cb234a6c7a38b 100644 (file)
@@ -8,7 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// no-system-llvm -- needs MCSubtargetInfo::getFeatureTable()
+// min-llvm-version 6.0
+// ^ needs MCSubtargetInfo::checkFeatures()
 // ignore-cloudabi no std::env
 
 #![feature(cfg_target_feature)]
@@ -29,4 +30,7 @@ fn main() {
         assert!(cfg!(target_feature = "sse2"),
                 "SSE2 was not detected as available on an x86 platform");
     }
+    // check a negative case too -- whitelisted on x86, but not enabled by default
+    assert!(cfg!(not(target_feature = "avx2")),
+            "AVX2 shouldn't be detected as available by default on any platform");
 }