about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKirill Podoprigora <kirill.bast9@mail.ru>2024-11-13 15:31:07 +0200
committerKirill Podoprigora <kirill.bast9@mail.ru>2024-11-13 15:31:07 +0200
commit81f61058519a408ca8d55e87435f092cc967de8b (patch)
tree5de90352d9666a8b3edcf80028da82930ae0203c
parent98a71766b8b6ece6fabb8429e5fe53805ba28b78 (diff)
downloadrust-81f61058519a408ca8d55e87435f092cc967de8b.tar.gz
rust-81f61058519a408ca8d55e87435f092cc967de8b.zip
Address review
-rw-r--r--src/tools/compiletest/src/header.rs6
-rw-r--r--src/tools/compiletest/src/header/tests.rs6
2 files changed, 9 insertions, 3 deletions
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 5b198c3e60b..0e81f675474 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -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
                     ),
                 };
diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs
index 1eca48c1c3a..6c52a1b9507 100644
--- a/src/tools/compiletest/src/header/tests.rs
+++ b/src/tools/compiletest/src/header/tests.rs
@@ -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]