Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
Eclips4 committed Nov 13, 2024
1 parent 98a7176 commit 81f6105
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1588,12 +1588,12 @@ fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision {
} else if let Some(version_string) =
config.parse_name_value_directive(line, "exact-llvm-major-version")
{
// Syntax is "only-llvm-major-version: <version>"
// Syntax is "exact-llvm-major-version: <version>"
let version = extract_llvm_version(&version_string);
if actual_version.major > version.major || actual_version.major < version.major {
if actual_version.major != version.major {
return IgnoreDecision::Ignore {
reason: format!(
"ignored when the LLVM major version is {}, but it should be {}",
"ignored when the actual LLVM major version is {}, but the test only targets major version {}",
actual_version.major, version.major
),
};
Expand Down
6 changes: 6 additions & 0 deletions src/tools/compiletest/src/header/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ fn llvm_version() {

let config: Config = cfg().llvm_version("10.0.0").build();
assert!(!check_ignore(&config, "//@ exact-llvm-major-version: 10.0"));

let config: Config = cfg().llvm_version("10.0.0").build();
assert!(!check_ignore(&config, "//@ exact-llvm-major-version: 10"));

let config: Config = cfg().llvm_version("10.6.2").build();
assert!(!check_ignore(&config, "//@ exact-llvm-major-version: 10"));
}

#[test]
Expand Down

0 comments on commit 81f6105

Please sign in to comment.