Skip to content

Commit 406eddf

Browse files
committed
Add a no-system-llvm compilecheck header
1 parent 8938269 commit 406eddf

File tree

6 files changed

+15
-10
lines changed

6 files changed

+15
-10
lines changed

src/bootstrap/check.rs

+3
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ pub fn compiletest(build: &Build,
245245
let llvm_config = build.llvm_config(target);
246246
let llvm_version = output(Command::new(&llvm_config).arg("--version"));
247247
cmd.arg("--llvm-version").arg(llvm_version);
248+
if !build.is_rust_llvm(target) {
249+
cmd.arg("--system-llvm");
250+
}
248251

249252
cmd.args(&build.flags.cmd.test_args());
250253

src/test/codegen/alloc-optimisation.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,11 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10+
//
11+
// no-system-llvm
12+
// compile-flags: -O
1013
#![crate_type="lib"]
1114

12-
#[no_mangle]
13-
pub fn alloc_zeroed_test(size: u8) {
14-
// CHECK-LABEL: @alloc_zeroed_test
15-
// CHECK-NEXT: start:
16-
// CHECK-NEXT: ret void
17-
let x = vec![0u8; size as usize];
18-
drop(x);
19-
}
20-
2115
#[no_mangle]
2216
pub fn alloc_test(data: u32) {
2317
// CHECK-LABEL: @alloc_test

src/tools/compiletest/src/common.rs

+3
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ pub struct Config {
166166
// Version of LLVM
167167
pub llvm_version: Option<String>,
168168

169+
// Is LLVM a system LLVM
170+
pub system_llvm: bool,
171+
169172
// Path to the android tools
170173
pub android_cross_path: PathBuf,
171174

src/tools/compiletest/src/header.rs

+3
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ impl EarlyProps {
166166
}
167167

168168
fn ignore_llvm(config: &Config, line: &str) -> bool {
169+
if config.system_llvm && line.starts_with("no-system-llvm") {
170+
return true;
171+
}
169172
if let Some(ref actual_version) = config.llvm_version {
170173
if line.starts_with("min-llvm-version") {
171174
let min_version = line.trim_right()

src/tools/compiletest/src/main.rs

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
9797
optopt("", "gdb", "path to GDB to use for GDB debuginfo tests", "PATH"),
9898
optopt("", "lldb-version", "the version of LLDB used", "VERSION STRING"),
9999
optopt("", "llvm-version", "the version of LLVM used", "VERSION STRING"),
100+
optflag("", "system-llvm", "is LLVM the system LLVM"),
100101
optopt("", "android-cross-path", "Android NDK standalone path", "PATH"),
101102
optopt("", "adb-path", "path to the android debugger", "PATH"),
102103
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
@@ -183,6 +184,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
183184
gdb_native_rust: gdb_native_rust,
184185
lldb_version: extract_lldb_version(matches.opt_str("lldb-version")),
185186
llvm_version: matches.opt_str("llvm-version"),
187+
system_llvm: matches.opt_present("system-llvm"),
186188
android_cross_path: opt_path(matches, "android-cross-path"),
187189
adb_path: opt_str2(matches.opt_str("adb-path")),
188190
adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")),

0 commit comments

Comments
 (0)