summaryrefslogtreecommitdiff
path: root/lld/test/MachO
diff options
context:
space:
mode:
authorMingming Liu <mingmingl@google.com>2025-09-10 15:25:31 -0700
committerGitHub <noreply@github.com>2025-09-10 15:25:31 -0700
commit1417dafa1db9cb1b2b09438aa9f53ea5ab6e36e2 (patch)
tree57f4b1f313c8cf74eed8819870f39c36ea263c68 /lld/test/MachO
parent898b813bc8a6d0276bf0f4769f5f2f64b34e632d (diff)
parentb8cefcb601ddaa18482555c4ff363c01a270c2fe (diff)
Merge branch 'main' into users/mingmingl-llvm/samplefdo-profile-formatusers/mingmingl-llvm/samplefdo-profile-format
Diffstat (limited to 'lld/test/MachO')
-rw-r--r--lld/test/MachO/cgdata-generate-merge.s12
-rw-r--r--lld/test/MachO/cgdata-generate.s12
-rw-r--r--lld/test/MachO/color-diagnostics.test2
-rw-r--r--lld/test/MachO/framework.s3
-rw-r--r--lld/test/MachO/implicit-and-allowable-clients.test5
-rwxr-xr-xlld/test/MachO/invalid/Inputs/macho-trie-node-loopbin0 -> 8752 bytes
-rw-r--r--lld/test/MachO/invalid/export-trie-node-loop.s9
-rw-r--r--lld/test/MachO/link-search-at-loader-path-symlink.s4
-rw-r--r--lld/test/MachO/lto-cache-warnings.ll12
-rw-r--r--lld/test/MachO/read-workers.s16
-rw-r--r--lld/test/MachO/reexport-with-symlink.s3
-rw-r--r--lld/test/MachO/reexport-without-rpath.s4
-rw-r--r--lld/test/MachO/reproduce.s4
-rw-r--r--lld/test/MachO/stabs.s89
-rw-r--r--lld/test/MachO/tapi-rpath.s4
15 files changed, 120 insertions, 59 deletions
diff --git a/lld/test/MachO/cgdata-generate-merge.s b/lld/test/MachO/cgdata-generate-merge.s
index 3f7fb6777bc3..4b6d4a5d824c 100644
--- a/lld/test/MachO/cgdata-generate-merge.s
+++ b/lld/test/MachO/cgdata-generate-merge.s
@@ -5,11 +5,15 @@
# Synthesize raw cgdata without the header (32 byte) from the indexed cgdata.
# RUN: llvm-cgdata --convert --format binary %t/raw-1.cgtext -o %t/raw-1.cgdata
-# RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ][ ]*/ /g; s/^[ ]*//; s/[ ]*$//; s/[ ]/,0x/g; s/^/0x/' > %t/raw-1-bytes.txt
-# RUN: sed "s/<RAW_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-template.s > %t/merge-1.s
+# RUN: echo -n "s/<RAW_BYTES>/" > %t/raw-1-sed.txt
+# RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ][ ]*/ /g; s/^[ ]*//; s/[ ]*$//; s/[ ]/,0x/g; s/^/0x/' >> %t/raw-1-sed.txt
+# RUN: echo "/g" >> %t/raw-1-sed.txt
+# RUN: sed -f %t/raw-1-sed.txt %t/merge-template.s > %t/merge-1.s
# RUN: llvm-cgdata --convert --format binary %t/raw-2.cgtext -o %t/raw-2.cgdata
-# RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ][ ]*/ /g; s/^[ ]*//; s/[ ]*$//; s/[ ]/,0x/g; s/^/0x/' > %t/raw-2-bytes.txt
-# RUN: sed "s/<RAW_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-template.s > %t/merge-2.s
+# RUN: echo -n "s/<RAW_BYTES>/" > %t/raw-2-sed.txt
+# RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ][ ]*/ /g; s/^[ ]*//; s/[ ]*$//; s/[ ]/,0x/g; s/^/0x/' >> %t/raw-2-sed.txt
+# RUN: echo "/g" >> %t/raw-2-sed.txt
+# RUN: sed -f %t/raw-2-sed.txt %t/merge-template.s > %t/merge-2.s
# RUN: llvm-mc -filetype obj -triple arm64-apple-darwin %t/merge-1.s -o %t/merge-1.o
# RUN: llvm-mc -filetype obj -triple arm64-apple-darwin %t/merge-2.s -o %t/merge-2.o
diff --git a/lld/test/MachO/cgdata-generate.s b/lld/test/MachO/cgdata-generate.s
index f942ae07f64e..63efc81cda17 100644
--- a/lld/test/MachO/cgdata-generate.s
+++ b/lld/test/MachO/cgdata-generate.s
@@ -5,11 +5,15 @@
# Synthesize raw cgdata without the header (32 byte) from the indexed cgdata.
# RUN: llvm-cgdata --convert --format binary %t/raw-1.cgtext -o %t/raw-1.cgdata
-# RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ][ ]*/ /g; s/^[ ]*//; s/[ ]*$//; s/[ ]/,0x/g; s/^/0x/' > %t/raw-1-bytes.txt
-# RUN: sed "s/<RAW_BYTES>/$(cat %t/raw-1-bytes.txt)/g" %t/merge-template.s > %t/merge-1.s
+# RUN: echo -n "s/<RAW_BYTES>/" > %t/raw-1-sed.txt
+# RUN: od -t x1 -j 32 -An %t/raw-1.cgdata | tr -d '\n\r\t' | sed 's/[ ][ ]*/ /g; s/^[ ]*//; s/[ ]*$//; s/[ ]/,0x/g; s/^/0x/' >> %t/raw-1-sed.txt
+# RUN: echo "/g" >> %t/raw-1-sed.txt
+# RUN: sed -f %t/raw-1-sed.txt %t/merge-template.s > %t/merge-1.s
# RUN: llvm-cgdata --convert --format binary %t/raw-2.cgtext -o %t/raw-2.cgdata
-# RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ][ ]*/ /g; s/^[ ]*//; s/[ ]*$//; s/[ ]/,0x/g; s/^/0x/' > %t/raw-2-bytes.txt
-# RUN: sed "s/<RAW_BYTES>/$(cat %t/raw-2-bytes.txt)/g" %t/merge-template.s > %t/merge-2.s
+# RUN: echo -n "s/<RAW_BYTES>/" > %t/raw-2-sed.txt
+# RUN: od -t x1 -j 32 -An %t/raw-2.cgdata | tr -d '\n\r\t' | sed 's/[ ][ ]*/ /g; s/^[ ]*//; s/[ ]*$//; s/[ ]/,0x/g; s/^/0x/' >> %t/raw-2-sed.txt
+# RUN: echo "/g" >> %t/raw-2-sed.txt
+# RUN: sed -f %t/raw-2-sed.txt %t/merge-template.s > %t/merge-2.s
# RUN: llvm-mc -filetype obj -triple arm64-apple-darwin %t/merge-1.s -o %t/merge-1.o
# RUN: llvm-mc -filetype obj -triple arm64-apple-darwin %t/merge-2.s -o %t/merge-2.o
diff --git a/lld/test/MachO/color-diagnostics.test b/lld/test/MachO/color-diagnostics.test
index b079c82e1a43..465cba1750bc 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 38925847935b..c62eb12d31e8 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 f627d242a007..f5c13c250ea4 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/invalid/Inputs/macho-trie-node-loop b/lld/test/MachO/invalid/Inputs/macho-trie-node-loop
new file mode 100755
index 000000000000..b94dfa2610e9
--- /dev/null
+++ b/lld/test/MachO/invalid/Inputs/macho-trie-node-loop
Binary files differ
diff --git a/lld/test/MachO/invalid/export-trie-node-loop.s b/lld/test/MachO/invalid/export-trie-node-loop.s
new file mode 100644
index 000000000000..fe991597fe5a
--- /dev/null
+++ b/lld/test/MachO/invalid/export-trie-node-loop.s
@@ -0,0 +1,9 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
+# RUN: not %lld -o %t %t.o %S/Inputs/macho-trie-node-loop 2>&1 | FileCheck %s
+# CHECK: error:
+# CHECK-SAME: /Inputs/macho-trie-node-loop: export trie child node infinite loop
+
+.globl _main
+_main:
+ ret
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 ff0f9481addf..8b0aeb7faf0b 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/lto-cache-warnings.ll b/lld/test/MachO/lto-cache-warnings.ll
index 50fa5c16a41b..de6324ab60f1 100644
--- a/lld/test/MachO/lto-cache-warnings.ll
+++ b/lld/test/MachO/lto-cache-warnings.ll
@@ -1,4 +1,4 @@
-; REQUIRES: x86, shell
+; REQUIRES: x86
; RUN: rm -rf %t; split-file %s %t
; RUN: opt -module-hash -module-summary %t/foo.ll -o %t/foo.o
@@ -19,13 +19,17 @@
;; Get the total size of created cache files.
; RUN: cd %t
; RUN: %lld -cache_path_lto %t --thinlto-cache-policy=prune_interval=0s:cache_size_bytes=32k %t/foo.o %t/bar.o -o %t/test 2>&1
-; RUN: %python -c "import os, sys; print(sum(os.path.getsize(filename) for filename in os.listdir('.') if os.path.isfile(filename) and filename.startswith('llvmcache-')))" > %t.size.txt
+; RUN: %python -c "import os, sys; size=sum(os.path.getsize(filename) for filename in os.listdir('.') if os.path.isfile(filename) and filename.startswith('llvmcache-')); print(size+5); print(size-5)" > %t.size.txt
;; Case 2: If the total size of the cache files created by the current link job is less than the maximum size for the cache directory in bytes, there is no warning.
-; RUN: %lld -v -cache_path_lto %t --thinlto-cache-policy=prune_interval=0s:cache_size_bytes=$(($(cat %t.size.txt) + 5)) %t/foo.o %t/bar.o -o %t/test 2>&1 | FileCheck %s --implicit-check-not=warning:
+; RUN: echo -n "--thinlto-cache-policy=prune_interval=0s:cache_size_bytes=" > %t.response
+; RUN: head -1 %t.size.txt >> %t.response
+; RUN: %lld -v -cache_path_lto %t @%t.response %t/foo.o %t/bar.o -o %t/test 2>&1 | FileCheck %s --implicit-check-not=warning:
;; Case 3: If the total size of the cache files created by the current link job exceeds the maximum size for the cache directory in bytes, a warning is given.
-; RUN: %lld -v -cache_path_lto %t --thinlto-cache-policy=prune_interval=0s:cache_size_bytes=$(($(cat %t.size.txt) - 5)) %t/foo.o %t/bar.o -o %t/test 2>&1 | FileCheck %s --check-prefixes=SIZE,WARN
+; RUN: echo -n "--thinlto-cache-policy=prune_interval=0s:cache_size_bytes=" > %t.response
+; RUN: tail -1 %t.size.txt >> %t.response
+; RUN: %lld -v -cache_path_lto %t @%t.response %t/foo.o %t/bar.o -o %t/test 2>&1 | FileCheck %s --check-prefixes=SIZE,WARN
;; Check emit two warnings if pruning happens due to reach both the size and number limits.
; RUN: %lld -cache_path_lto %t --thinlto-cache-policy=prune_interval=0s:cache_size_files=1:cache_size_bytes=1 %t/foo.o %t/bar.o -o %t/test 2>&1 | FileCheck %s --check-prefixes=NUM,SIZE,WARN
diff --git a/lld/test/MachO/read-workers.s b/lld/test/MachO/read-workers.s
new file mode 100644
index 000000000000..6f0ea4d89440
--- /dev/null
+++ b/lld/test/MachO/read-workers.s
@@ -0,0 +1,16 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
+
+## A non-negative integer is allowed.
+# RUN: %lld --read-workers=0 %t.o -o /dev/null
+# RUN: %lld --read-workers=1 %t.o -o /dev/null
+# RUN: %lld --read-workers=2 %t.o -o /dev/null
+
+# RUN: not %lld --read-workers=all %t.o -o /dev/null 2>&1 | FileCheck %s -DN=all
+# RUN: not %lld --read-workers=-1 %t.o -o /dev/null 2>&1 | FileCheck %s -DN=-1
+
+# CHECK: error: --read-workers=: expected a non-negative integer, but got '[[N]]'
+
+.globl _main
+_main:
+ ret
diff --git a/lld/test/MachO/reexport-with-symlink.s b/lld/test/MachO/reexport-with-symlink.s
index a6b5992713f3..c9cde5bc4f18 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 741c33e81630..a204c140c4a7 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 6f2ec680e124..68d94cab2c7e 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/stabs.s b/lld/test/MachO/stabs.s
index e32b9fc5b50d..065dccbe72b4 100644
--- a/lld/test/MachO/stabs.s
+++ b/lld/test/MachO/stabs.s
@@ -1,4 +1,4 @@
-# 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/test.s -o %t/test.o
@@ -9,61 +9,69 @@
# RUN: env TZ=GMT touch -t "197001010000.32" %t/foo.o
# RUN: llvm-ar rcsU %t/foo.a %t/foo.o
-# RUN: ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o -o %t/test
-# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
-# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
-# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20
+# RUN: env ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o -o %t/test
+# RUN: llvm-objdump --section-headers %t/test > %t.out
+# RUN: dsymutil -s %t/test >> %t.out
+# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
+# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out
## Check that we emit the right modtime even when the object file is in an
## archive.
-# RUN: ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o -o %t/test
-# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
-# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
-# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20
+# RUN: env ZERO_AR_DATE=0 %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o -o %t/test
+# RUN: llvm-objdump --section-headers %t/test > %t.out
+# RUN: dsymutil -s %t/test >> %t.out
+# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
+# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out
## Check that we don't emit modtimes if ZERO_AR_DATE is set.
# RUN: env ZERO_AR_DATE=1 %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o \
# RUN: -o %t/test
-# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
-# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
-# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0
+# RUN: llvm-objdump --section-headers %t/test > %t.out
+# RUN: dsymutil -s %t/test >> %t.out
+# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
+# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out
# RUN: env %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o \
# RUN: -o %t/test
-# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
-# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
-# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0
+# RUN: llvm-objdump --section-headers %t/test > %t.out
+# RUN: dsymutil -s %t/test >> %t.out
+# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
+# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out
# RUN: env %lld -lSystem %t/test.o %t/no-debug.o \
# RUN: -all_load %t/foo.a -o %t/test
-# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
-# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
-# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0
+# RUN: llvm-objdump --section-headers %t/test > %t.out
+# RUN: dsymutil -s %t/test >> %t.out
+# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
+# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out
# RUN: env %lld -lSystem %t/test.o %t/no-debug.o \
# RUN: -force_load %t/foo.a -o %t/test
-# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
-# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
-# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0
+# RUN: llvm-objdump --section-headers %t/test > %t.out
+# RUN: dsymutil -s %t/test >> %t.out
+# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
+# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out
# RUN: env ZERO_AR_DATE=0 %lld -lSystem -reproducible %t/test.o %t/foo.o \
# RUN: %t/no-debug.o -o %t/test
-# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
-# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
-# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0
+# RUN: llvm-objdump --section-headers %t/test > %t.out
+# RUN: dsymutil -s %t/test >> %t.out
+# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
+# RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 --input-file %t.out
## Check that we emit absolute paths to the object files in our OSO entries
## even if our inputs are relative paths.
-# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -o test
-# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
-# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
-# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20
+# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -o test
+# RUN: llvm-objdump --section-headers %t/test > %t.out
+# RUN: dsymutil -s %t/test >> %t.out
+# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \
+# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out
## Check that we emit relative path to object files in OSO entries
## when -oso_prefix <path> is used.
-# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t" -o %t/test-rel
+# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t" -o %t/test-rel
# RUN: dsymutil -s %t/test-rel | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-PATH
-# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t/" -o %t/test-rel
+# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t/" -o %t/test-rel
# RUN: dsymutil -s %t/test-rel | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-PATH-NO-SLASH
-# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o %t/test-rel-dot
+# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o %t/test-rel-dot
# RUN: dsymutil -s %t/test-rel-dot | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT
-# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o %t/test-rel-dot
+# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o %t/test-rel-dot
# RUN: dsymutil -s %t/test-rel-dot | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT-EXPLICIT
## Check that symlinks are not expanded when -oso_prefix . is used.
@@ -71,9 +79,9 @@
# RUN: cp %t/test.o %t/foo.o %t/no-debug.o %t/private/var/folders/tmp
# RUN: env TZ=GMT touch -t "197001010000.16" %t/private/var/folders/tmp/test.o
# RUN: env TZ=GMT touch -t "197001010000.32" %t/private/var/folders/tmp/foo.o
-# RUN: cd %t/var/folders/tmp && ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o test-rel-symlink
+# RUN: cd %t/var/folders/tmp && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o test-rel-symlink
# RUN: dsymutil -s %t/private/var/folders/tmp/test-rel-symlink | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT
-# RUN: cd %t/var/folders/tmp && ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o test-rel-symlink
+# RUN: cd %t/var/folders/tmp && env ZERO_AR_DATE=0 %lld -lSystem ./test.o ./foo.o ./no-debug.o -oso_prefix "." -o test-rel-symlink
# RUN: dsymutil -s %t/private/var/folders/tmp/test-rel-symlink | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT-EXPLICIT
## Check that we don't emit DWARF or stabs when -S is used
@@ -82,10 +90,11 @@
## expect to not find any entries which requires the exit code to be negated.
# RUN: llvm-nm -ap %t/test-no-debug | not grep -e ' - '
-# RUN: cd %t && ZERO_AR_DATE=0 %lld -lSystem test.o foo.a no-debug.o -o %t/test
-# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \
-# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
-# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20
+# RUN: cd %t && env ZERO_AR_DATE=0 %lld -lSystem test.o foo.a no-debug.o -o %t/test
+# RUN: llvm-objdump --section-headers %t/test > %t.out
+# RUN: dsymutil -s %t/test >> %t.out
+# RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \
+# RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --input-file %t.out
# CHECK: Sections:
# CHECK-NEXT: Idx Name
@@ -159,7 +168,9 @@
## when forming N_SO.
# RUN: llvm-mc -filetype obj -triple=x86_64-apple-darwin %t/abs-path.s -o %t/abs-path.o
# RUN: %lld %t/abs-path.o -o %t/test
-# RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | FileCheck %s --check-prefix=ABS-PATH
+# RUN: llvm-objdump --section-headers %t/test > %t.out
+# RUN: dsymutil -s %t/test >> %t.out
+# RUN: FileCheck %s --check-prefix=ABS-PATH --input-file %t.out
# ABS-PATH: (N_SO ) 00 0000 0000000000000000 '/foo.cpp'
#--- test.s
diff --git a/lld/test/MachO/tapi-rpath.s b/lld/test/MachO/tapi-rpath.s
index 48032f28a6ce..23187e797466 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/