Skip to content

Commit 81f6105

Browse files
committed
Address review
1 parent 98a7176 commit 81f6105

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/tools/compiletest/src/header.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1588,12 +1588,12 @@ fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision {
15881588
} else if let Some(version_string) =
15891589
config.parse_name_value_directive(line, "exact-llvm-major-version")
15901590
{
1591-
// Syntax is "only-llvm-major-version: <version>"
1591+
// Syntax is "exact-llvm-major-version: <version>"
15921592
let version = extract_llvm_version(&version_string);
1593-
if actual_version.major > version.major || actual_version.major < version.major {
1593+
if actual_version.major != version.major {
15941594
return IgnoreDecision::Ignore {
15951595
reason: format!(
1596-
"ignored when the LLVM major version is {}, but it should be {}",
1596+
"ignored when the actual LLVM major version is {}, but the test only targets major version {}",
15971597
actual_version.major, version.major
15981598
),
15991599
};

src/tools/compiletest/src/header/tests.rs

+6
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@ fn llvm_version() {
293293

294294
let config: Config = cfg().llvm_version("10.0.0").build();
295295
assert!(!check_ignore(&config, "//@ exact-llvm-major-version: 10.0"));
296+
297+
let config: Config = cfg().llvm_version("10.0.0").build();
298+
assert!(!check_ignore(&config, "//@ exact-llvm-major-version: 10"));
299+
300+
let config: Config = cfg().llvm_version("10.6.2").build();
301+
assert!(!check_ignore(&config, "//@ exact-llvm-major-version: 10"));
296302
}
297303

298304
#[test]

0 commit comments

Comments
 (0)