about summary refs log tree commit diff
path: root/src/tools/compiletest
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-01-06 17:23:28 +0100
committerJakub Beránek <berykubik@gmail.com>2025-01-21 10:20:24 +0100
commitef9349db86dcbbe705aaf40a2f5dcb1dd9c9063e (patch)
tree657d7333da396b35cb4d05c49ca2442b3b6062da /src/tools/compiletest
parentb605c65b6eb5fa71783f8e26df69975f9f1680ee (diff)
downloadrust-ef9349db86dcbbe705aaf40a2f5dcb1dd9c9063e.tar.gz
rust-ef9349db86dcbbe705aaf40a2f5dcb1dd9c9063e.zip
Add test for checking used glibc symbols
Diffstat (limited to 'src/tools/compiletest')
-rw-r--r--src/tools/compiletest/src/directive-list.rs1
-rw-r--r--src/tools/compiletest/src/header.rs2
-rw-r--r--src/tools/compiletest/src/header/cfg.rs6
3 files changed, 8 insertions, 1 deletions
diff --git a/src/tools/compiletest/src/directive-list.rs b/src/tools/compiletest/src/directive-list.rs
index 01068af3e8c..5784cd83119 100644
--- a/src/tools/compiletest/src/directive-list.rs
+++ b/src/tools/compiletest/src/directive-list.rs
@@ -175,6 +175,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
     "only-beta",
     "only-bpf",
     "only-cdb",
+    "only-dist",
     "only-gnu",
     "only-i686-pc-windows-gnu",
     "only-i686-pc-windows-msvc",
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 8c96554738e..82925f54a16 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -1280,7 +1280,7 @@ pub fn llvm_has_libzstd(config: &Config) -> bool {
             let stderr = String::from_utf8(output.stderr).ok()?;
             let zstd_available = !stderr.contains("LLVM was not built with LLVM_ENABLE_ZSTD");
 
-            // We don't particularly need to clean the link up (so the previous commands could fail
+            // We don't partiCOMPILETEST_ENABLE_OPT_DIST_TESTScularly need to clean the link up (so the previous commands could fail
             // in theory but won't in practice), but we can try.
             std::fs::remove_file(lld_symlink_path).ok()?;
 
diff --git a/src/tools/compiletest/src/header/cfg.rs b/src/tools/compiletest/src/header/cfg.rs
index 3f7225195ce..6e5ced17c20 100644
--- a/src/tools/compiletest/src/header/cfg.rs
+++ b/src/tools/compiletest/src/header/cfg.rs
@@ -235,6 +235,12 @@ fn parse_cfg_name_directive<'a>(
         message: "when the test mode is {name}",
     }
 
+    condition! {
+        name: "dist",
+        condition: std::env::var("COMPILETEST_ENABLE_DIST_TESTS") == Ok("1".to_string()),
+        message: "when performing tests on dist toolchain"
+    }
+
     if prefix == "ignore" && outcome == MatchOutcome::Invalid {
         // Don't error out for ignore-tidy-* diretives, as those are not handled by compiletest.
         if name.starts_with("tidy-") {