[lld] [lld] Remove shell requirements from tests (PR #156510)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 11:04:34 PDT 2025


https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/156510

These tests all pass inside the lit internal shell. A couple were marked
as requiring a shell to exclude them on Windows. Update those tests to
explicitly carve out Windows rather than any configuration that does not
provide the shell feature.

Towards #102700.


>From 00357414d005865ee33aff4d7ed5862b14e05b1a Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Tue, 2 Sep 2025 18:04:22 +0000
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.6
---
 lld/test/COFF/color-diagnostics.test                | 2 +-
 lld/test/COFF/linkrepro-res.test                    | 4 +++-
 lld/test/COFF/linkrepro.test                        | 4 +++-
 lld/test/ELF/arm-exidx-range.s                      | 4 +++-
 lld/test/ELF/color-diagnostics.test                 | 2 +-
 lld/test/ELF/file-access.s                          | 2 +-
 lld/test/ELF/linkerscript/invalid.test              | 2 +-
 lld/test/ELF/lto/resolution-err.ll                  | 2 +-
 lld/test/MachO/color-diagnostics.test               | 2 +-
 lld/test/MachO/framework.s                          | 2 +-
 lld/test/MachO/implicit-and-allowable-clients.test  | 5 ++++-
 lld/test/MachO/link-search-at-loader-path-symlink.s | 2 +-
 lld/test/MachO/reexport-with-symlink.s              | 2 +-
 lld/test/MachO/reexport-without-rpath.s             | 2 +-
 lld/test/MachO/reproduce.s                          | 4 +++-
 lld/test/MachO/tapi-rpath.s                         | 2 +-
 lld/test/lit.cfg.py                                 | 2 +-
 lld/test/wasm/reproduce.s                           | 3 ++-
 18 files changed, 30 insertions(+), 18 deletions(-)

diff --git a/lld/test/COFF/color-diagnostics.test b/lld/test/COFF/color-diagnostics.test
index 210965d5267cf..37583462f44f1 100644
--- a/lld/test/COFF/color-diagnostics.test
+++ b/lld/test/COFF/color-diagnostics.test
@@ -1,5 +1,5 @@
 # Windows command prompt doesn't support ANSI escape sequences.
-# REQUIRES: shell
+# UNSUPPORTED: system-windows
 
 # RUN: not lld-link -xyz --color-diagnostics /nosuchfile 2>&1 \
 # RUN:   | FileCheck -check-prefix=COLOR %s
diff --git a/lld/test/COFF/linkrepro-res.test b/lld/test/COFF/linkrepro-res.test
index cf0aa1636ce2d..fe564e9776114 100644
--- a/lld/test/COFF/linkrepro-res.test
+++ b/lld/test/COFF/linkrepro-res.test
@@ -1,4 +1,6 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86
+# Unsupported on Windows due to maximum path length limitations.
+# UNSUPPORTED: system-windows
 
 # RUN: rm -rf %t.dir
 # RUN: mkdir -p %t.dir/build
diff --git a/lld/test/COFF/linkrepro.test b/lld/test/COFF/linkrepro.test
index a5779a9ec82e1..b1195cccb0e8a 100644
--- a/lld/test/COFF/linkrepro.test
+++ b/lld/test/COFF/linkrepro.test
@@ -1,4 +1,6 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86
+# Unsupported on Windows due to maximum path length limitations.
+# UNSUPPORTED: system-windows
 
 # RUN: rm -rf %t.dir
 # RUN: split-file %s %t.dir
diff --git a/lld/test/ELF/arm-exidx-range.s b/lld/test/ELF/arm-exidx-range.s
index 4809109973585..b955b39e29f5c 100644
--- a/lld/test/ELF/arm-exidx-range.s
+++ b/lld/test/ELF/arm-exidx-range.s
@@ -1,4 +1,6 @@
-// REQUIRES: arm, shell
+// REQUIRES: arm
+// Fails for unclear reasons on 32-bit windows
+// UNSUPPORTED: system-windows
 // RUN: llvm-mc --arm-add-build-attributes --triple=armv7a-linux-gnueabihf -filetype=obj %s -o %t.o
 // RUN: echo "SECTIONS { \
 // RUN:         . = 0x80000000; \
diff --git a/lld/test/ELF/color-diagnostics.test b/lld/test/ELF/color-diagnostics.test
index 6d87b1130bee2..ad201fada283d 100644
--- a/lld/test/ELF/color-diagnostics.test
+++ b/lld/test/ELF/color-diagnostics.test
@@ -1,5 +1,5 @@
 # Windows command prompt doesn't support ANSI escape sequences.
-# REQUIRES: shell
+# UNSUPPORTED: system-windows
 
 # RUN: not ld.lld -xyz --color-diagnostics /nosuchfile 2>&1 \
 # RUN:   | FileCheck -check-prefix=COLOR %s
diff --git a/lld/test/ELF/file-access.s b/lld/test/ELF/file-access.s
index 5a9e53b111404..47b6500969482 100644
--- a/lld/test/ELF/file-access.s
+++ b/lld/test/ELF/file-access.s
@@ -1,4 +1,4 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
 # RUN: ld.lld -r %t.o -o %t1.o
diff --git a/lld/test/ELF/linkerscript/invalid.test b/lld/test/ELF/linkerscript/invalid.test
index 73b761ce4d571..cb5e52c38dccc 100644
--- a/lld/test/ELF/linkerscript/invalid.test
+++ b/lld/test/ELF/linkerscript/invalid.test
@@ -5,7 +5,7 @@
 ## We can't write quoted strings that are interpreted the same way
 ## by all echo commands. So, we don't want to run this on Windows.
 
-# REQUIRES: shell
+# UNSUPPORTED: system-windows
 
 # RUN: mkdir -p %t.dir
 
diff --git a/lld/test/ELF/lto/resolution-err.ll b/lld/test/ELF/lto/resolution-err.ll
index f9855abaff327..6bc0bfc2f200d 100644
--- a/lld/test/ELF/lto/resolution-err.ll
+++ b/lld/test/ELF/lto/resolution-err.ll
@@ -1,5 +1,5 @@
 ; UNSUPPORTED: system-windows
-; REQUIRES: shell, non-root-user
+; REQUIRES: non-root-user
 ; RUN: llvm-as %s -o %t.bc
 ; RUN: touch %t.resolution.txt
 ; RUN: chmod u-w %t.resolution.txt
diff --git a/lld/test/MachO/color-diagnostics.test b/lld/test/MachO/color-diagnostics.test
index b079c82e1a43a..465cba1750bc3 100644
--- a/lld/test/MachO/color-diagnostics.test
+++ b/lld/test/MachO/color-diagnostics.test
@@ -1,5 +1,5 @@
 # Windows command prompt doesn't support ANSI escape sequences.
-# REQUIRES: shell
+# UNSUPPORTED: system-windows
 
 # RUN: not %lld --color-diagnostics /nosuchfile 2>&1 \
 # RUN:   | FileCheck -check-prefix=COLOR %s
diff --git a/lld/test/MachO/framework.s b/lld/test/MachO/framework.s
index 38925847935bb..775baa8ba8b6d 100644
--- a/lld/test/MachO/framework.s
+++ b/lld/test/MachO/framework.s
@@ -1,4 +1,4 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86
 # RUN: rm -rf %t; split-file %s %t
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o
 # RUN: mkdir -p %t/Foo.framework/Versions/A
diff --git a/lld/test/MachO/implicit-and-allowable-clients.test b/lld/test/MachO/implicit-and-allowable-clients.test
index f627d242a0075..f5c13c250ea4a 100644
--- a/lld/test/MachO/implicit-and-allowable-clients.test
+++ b/lld/test/MachO/implicit-and-allowable-clients.test
@@ -1,4 +1,7 @@
-# REQUIRES: aarch64, shell
+# ln -s is not guaranteed to work on Windows
+# UNSUPPORTED: system-windows
+
+# REQUIRES: aarch64
 # RUN: rm -rf %t; split-file %s %t
 # RUN: ln -s Versions/A/FrameworkPublic.tbd %t/System/Library/Frameworks/FrameworkPublic.framework/
 # RUN: ln -s Versions/A/FrameworkPrivate.tbd %t/System/Library/Frameworks/FrameworkPrivate.framework/
diff --git a/lld/test/MachO/link-search-at-loader-path-symlink.s b/lld/test/MachO/link-search-at-loader-path-symlink.s
index ff0f9481addf1..47faaa349d14b 100644
--- a/lld/test/MachO/link-search-at-loader-path-symlink.s
+++ b/lld/test/MachO/link-search-at-loader-path-symlink.s
@@ -1,4 +1,4 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86
 
 # RUN: rm -rf %t; split-file %s %t
 
diff --git a/lld/test/MachO/reexport-with-symlink.s b/lld/test/MachO/reexport-with-symlink.s
index a6b5992713f39..7aa77007630d6 100644
--- a/lld/test/MachO/reexport-with-symlink.s
+++ b/lld/test/MachO/reexport-with-symlink.s
@@ -1,4 +1,4 @@
-# REQUIRES: aarch64, shell
+# REQUIRES: aarch64
 # RUN: rm -rf %t; split-file %s %t
 # RUN: ln -s Versions/A/Developer %t/Developer/Library/Frameworks/Developer.framework/
 # RUN: llvm-mc -filetype obj -triple arm64-apple-macos11.0 %t/test.s -o %t/test.o
diff --git a/lld/test/MachO/reexport-without-rpath.s b/lld/test/MachO/reexport-without-rpath.s
index 741c33e81630d..bf0d9ef372727 100644
--- a/lld/test/MachO/reexport-without-rpath.s
+++ b/lld/test/MachO/reexport-without-rpath.s
@@ -1,4 +1,4 @@
-# REQUIRES: aarch64, shell
+# REQUIRES: aarch64
 # RUN: rm -rf %t; split-file %s %t
 # RUN: ln -s Versions/A/Developer %t/Developer/Library/Frameworks/Developer.framework/
 # RUN: ln -s Versions/A/DeveloperCore %t/Developer/Library/PrivateFrameworks/DeveloperCore.framework/
diff --git a/lld/test/MachO/reproduce.s b/lld/test/MachO/reproduce.s
index 6f2ec680e124c..4a625387a1d2d 100644
--- a/lld/test/MachO/reproduce.s
+++ b/lld/test/MachO/reproduce.s
@@ -1,4 +1,6 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86_64
+# Unsupported on Windows due to maximum path length limitations.
+# UNSUPPORTED: system-windows
 
 # RUN: rm -rf %t.dir
 # RUN: mkdir -p %t.dir/build1
diff --git a/lld/test/MachO/tapi-rpath.s b/lld/test/MachO/tapi-rpath.s
index 48032f28a6ce6..9cf1e3bd4f636 100644
--- a/lld/test/MachO/tapi-rpath.s
+++ b/lld/test/MachO/tapi-rpath.s
@@ -1,4 +1,4 @@
-# REQUIRES: aarch64, shell
+# REQUIRES: aarch64
 # RUN: rm -rf %t; split-file %s %t
 # RUN: ln -s Versions/A/Developer %t/Developer/Library/Frameworks/Developer.framework/
 # RUN: ln -s Versions/A/DeveloperCore %t/Developer/Library/PrivateFrameworks/DeveloperCore.framework/
diff --git a/lld/test/lit.cfg.py b/lld/test/lit.cfg.py
index 10f556567cdc8..1b3b67114c30b 100644
--- a/lld/test/lit.cfg.py
+++ b/lld/test/lit.cfg.py
@@ -19,7 +19,7 @@
 # testFormat: The test format to use to interpret tests.
 #
 # For now we require '&&' between commands, until they get globally killed and the test runner updated.
-config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
+config.test_format = lit.formats.ShTest(False)
 
 # suffixes: A list of file extensions to treat as test files.
 config.suffixes = [".ll", ".s", ".test", ".yaml", ".objtxt"]
diff --git a/lld/test/wasm/reproduce.s b/lld/test/wasm/reproduce.s
index a89843fe219e3..40e9ad3794d5e 100644
--- a/lld/test/wasm/reproduce.s
+++ b/lld/test/wasm/reproduce.s
@@ -1,4 +1,5 @@
-# REQUIRES: shell
+# Unsupported on Windows due to maximum path length limitations.
+# UNSUPPORTED: system-windows
 # RUN: rm -rf %t.dir
 # RUN: mkdir -p %t.dir
 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.dir/foo.o %s



More information about the llvm-commits mailing list