Skip to content

Commit a512228

Browse files
committed
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.
1 parent f93a492 commit a512228

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/tools/compiletest/src/header.rs

+8
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ impl EarlyProps {
150150
// Ignore if actual version is smaller the minimum required
151151
// version
152152
&actual_version[..] < min_version
153+
} else if line.starts_with("min-system-llvm-version") {
154+
let min_version = line.trim_right()
155+
.rsplit(' ')
156+
.next()
157+
.expect("Malformed llvm version directive");
158+
// Ignore if using system LLVM and actual version
159+
// is smaller the minimum required version
160+
!(config.system_llvm && &actual_version[..] < min_version)
153161
} else {
154162
false
155163
}

0 commit comments

Comments
 (0)