Skip to content

Commit

Permalink
Remove support for no-system-llvm
Browse files Browse the repository at this point in the history
Also add tests for min-system-llvm-version.
  • Loading branch information
nikic committed Jan 23, 2024
1 parent 31f5f03 commit f4f589a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
3 changes: 0 additions & 3 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,9 +1109,6 @@ fn ignore_lldb(config: &Config, line: &str) -> IgnoreDecision {
}

fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision {
if config.system_llvm && line.starts_with("no-system-llvm") {
return IgnoreDecision::Ignore { reason: "ignored when the system LLVM is used".into() };
}
if let Some(needed_components) =
config.parse_name_value_directive(line, "needs-llvm-components")
{
Expand Down
21 changes: 12 additions & 9 deletions src/tools/compiletest/src/header/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,6 @@ fn aux_build() {
);
}

#[test]
fn no_system_llvm() {
let config: Config = cfg().system_llvm(false).build();
assert!(!check_ignore(&config, "// no-system-llvm"));

let config: Config = cfg().system_llvm(true).build();
assert!(check_ignore(&config, "// no-system-llvm"));
}

#[test]
fn llvm_version() {
let config: Config = cfg().llvm_version("8.1.2").build();
Expand All @@ -266,6 +257,18 @@ fn llvm_version() {
assert!(!check_ignore(&config, "// min-llvm-version: 9.0"));
}

#[test]
fn system_llvm_version() {
let config: Config = cfg().system_llvm(true).llvm_version("17.0.0").build();
assert!(check_ignore(&config, "// min-system-llvm-version: 18.0"));

let config: Config = cfg().system_llvm(true).llvm_version("18.0.0").build();
assert!(!check_ignore(&config, "// min-system-llvm-version: 18.0"));

let config: Config = cfg().llvm_version("17.0.0").build();
assert!(!check_ignore(&config, "// min-system-llvm-version: 18.0"));
}

#[test]
fn ignore_target() {
let config: Config = cfg().target("x86_64-unknown-linux-gnu").build();
Expand Down

0 comments on commit f4f589a

Please sign in to comment.