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

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 3 08:50:23 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lld-wasm

Author: Aiden Grossman (boomanaiden154)

<details>
<summary>Changes</summary>

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.


---
Full diff: https://github.com/llvm/llvm-project/pull/156510.diff


17 Files Affected:

- (modified) lld/test/COFF/color-diagnostics.test (+1-1) 
- (modified) lld/test/COFF/linkrepro-res.test (+3-1) 
- (modified) lld/test/COFF/linkrepro.test (+3-1) 
- (modified) lld/test/ELF/arm-exidx-range.s (+3-1) 
- (modified) lld/test/ELF/color-diagnostics.test (+1-1) 
- (modified) lld/test/ELF/file-access.s (+2-1) 
- (modified) lld/test/ELF/linkerscript/invalid.test (+1-1) 
- (modified) lld/test/ELF/lto/resolution-err.ll (+1-1) 
- (modified) lld/test/MachO/color-diagnostics.test (+1-1) 
- (modified) lld/test/MachO/framework.s (+2-1) 
- (modified) lld/test/MachO/implicit-and-allowable-clients.test (+4-1) 
- (modified) lld/test/MachO/link-search-at-loader-path-symlink.s (+3-1) 
- (modified) lld/test/MachO/reexport-with-symlink.s (+2-1) 
- (modified) lld/test/MachO/reexport-without-rpath.s (+3-1) 
- (modified) lld/test/MachO/reproduce.s (+3-1) 
- (modified) lld/test/MachO/tapi-rpath.s (+3-1) 
- (modified) lld/test/wasm/reproduce.s (+2-1) 


``````````diff
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..8658f774682fe 100644
--- a/lld/test/ELF/file-access.s
+++ b/lld/test/ELF/file-access.s
@@ -1,4 +1,5 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86
+# UNSUPPORTED: system-windows
 
 # 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..c62eb12d31e8b 100644
--- a/lld/test/MachO/framework.s
+++ b/lld/test/MachO/framework.s
@@ -1,4 +1,5 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86
+# UNSUPPORTED: system-windows
 # 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..8b0aeb7faf0bf 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,6 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86
+# Windows does not support rpath
+# UNSUPPORTED: system-windows
 
 # 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..c9cde5bc4f18b 100644
--- a/lld/test/MachO/reexport-with-symlink.s
+++ b/lld/test/MachO/reexport-with-symlink.s
@@ -1,4 +1,5 @@
-# REQUIRES: aarch64, shell
+# REQUIRES: aarch64
+# UNSUPPORTED: system-windows
 # 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..a204c140c4a70 100644
--- a/lld/test/MachO/reexport-without-rpath.s
+++ b/lld/test/MachO/reexport-without-rpath.s
@@ -1,4 +1,6 @@
-# REQUIRES: aarch64, shell
+# REQUIRES: aarch64
+# Windows does not support rpath
+# UNSUPPORTED: system-windows
 # 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..68d94cab2c7ee 100644
--- a/lld/test/MachO/reproduce.s
+++ b/lld/test/MachO/reproduce.s
@@ -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/build1
diff --git a/lld/test/MachO/tapi-rpath.s b/lld/test/MachO/tapi-rpath.s
index 48032f28a6ce6..23187e797466b 100644
--- a/lld/test/MachO/tapi-rpath.s
+++ b/lld/test/MachO/tapi-rpath.s
@@ -1,4 +1,6 @@
-# REQUIRES: aarch64, shell
+# REQUIRES: aarch64
+# Windows does not support rpath
+# UNSUPPORTED: system-windows
 # 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/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

``````````

</details>


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


More information about the llvm-commits mailing list