about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-11-09 14:04:12 -0700
committerTom Tromey <tom@tromey.com>2017-11-15 01:43:24 -0700
commita5122281416e2c627c0610096ea3064a01bc2bb0 (patch)
treeaa3a0b8f231628fdb0f173f0fd4ada238d730999
parentf93a4928c2168bcc475b4fe77ba9f9e5494ffe1c (diff)
downloadrust-a5122281416e2c627c0610096ea3064a01bc2bb0.tar.gz
rust-a5122281416e2c627c0610096ea3064a01bc2bb0.zip
Allow minimum system LLVM version in tests
This adds a "min-system-llvm-version" directive, so that a test can
indicate that it will either work with rust-llvm or with some minimal
system LLVM.  This makes it simpler to write a test that requires an
LLVM patch that landed upstream and was then backported to rust-llvm.
-rw-r--r--src/tools/compiletest/src/header.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index e03d9f89e5d..430c02ccbf8 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -150,6 +150,14 @@ impl EarlyProps {
                     // Ignore if actual version is smaller the minimum required
                     // version
                     &actual_version[..] < min_version
+                } else if line.starts_with("min-system-llvm-version") {
+                    let min_version = line.trim_right()
+                        .rsplit(' ')
+                        .next()
+                        .expect("Malformed llvm version directive");
+                    // Ignore if using system LLVM and actual version
+                    // is smaller the minimum required version
+                    !(config.system_llvm && &actual_version[..] < min_version)
                 } else {
                     false
                 }