aboutsummaryrefslogtreecommitdiff
path: root/lld/test
diff options
context:
space:
mode:
Diffstat (limited to 'lld/test')
-rw-r--r--lld/test/CMakeLists.txt1
-rw-r--r--lld/test/MachO/read-workers-no-thread-support.s10
-rw-r--r--lld/test/MachO/read-workers.s5
-rw-r--r--lld/test/lit.cfg.py3
-rw-r--r--lld/test/lit.site.cfg.py.in1
5 files changed, 19 insertions, 1 deletions
diff --git a/lld/test/CMakeLists.txt b/lld/test/CMakeLists.txt
index abc8ea7..1bd3ad7 100644
--- a/lld/test/CMakeLists.txt
+++ b/lld/test/CMakeLists.txt
@@ -1,5 +1,6 @@
llvm_canonicalize_cmake_booleans(
ENABLE_BACKTRACES
+ LLVM_ENABLE_THREADS
LLVM_ENABLE_ZLIB
LLVM_ENABLE_ZSTD
LLVM_ENABLE_LIBXML2
diff --git a/lld/test/MachO/read-workers-no-thread-support.s b/lld/test/MachO/read-workers-no-thread-support.s
new file mode 100644
index 0000000..16256be
--- /dev/null
+++ b/lld/test/MachO/read-workers-no-thread-support.s
@@ -0,0 +1,10 @@
+# REQUIRES: x86 && !thread_support
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
+
+# RUN: not %lld --read-workers=1 %t.o -o /dev/null
+
+# CHECK: error: --read-workers=: option unavailable because lld was built without thread support
+
+.globl _main
+_main:
+ ret
diff --git a/lld/test/MachO/read-workers.s b/lld/test/MachO/read-workers.s
index 6f0ea4d..294106b 100644
--- a/lld/test/MachO/read-workers.s
+++ b/lld/test/MachO/read-workers.s
@@ -1,4 +1,7 @@
-# REQUIRES: x86
+# REQUIRES: x86 && thread_support
+## Sometimes fails, particularly in an ASAN build, do not run until
+## https://github.com/llvm/llvm-project/pull/157917 addresses the cause.
+# UNSUPPORTED: target={{.*}}
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
## A non-negative integer is allowed.
diff --git a/lld/test/lit.cfg.py b/lld/test/lit.cfg.py
index 3369457..39c3d0a 100644
--- a/lld/test/lit.cfg.py
+++ b/lld/test/lit.cfg.py
@@ -182,3 +182,6 @@ if tar_executable:
# ELF tests expect the default target for ld.lld to be ELF.
if config.ld_lld_default_mingw:
config.excludes.append("ELF")
+
+if config.enable_threads:
+ config.available_features.add("thread_support")
diff --git a/lld/test/lit.site.cfg.py.in b/lld/test/lit.site.cfg.py.in
index bb99976..703d3b1 100644
--- a/lld/test/lit.site.cfg.py.in
+++ b/lld/test/lit.site.cfg.py.in
@@ -26,6 +26,7 @@ config.ld_lld_default_mingw = @LLD_DEFAULT_LD_LLD_IS_MINGW@
config.build_examples = @LLVM_BUILD_EXAMPLES@
config.has_plugins = @LLVM_ENABLE_PLUGINS@
config.linked_bye_extension = @LLVM_BYE_LINK_INTO_TOOLS@
+config.enable_threads = @LLVM_ENABLE_THREADS@
import lit.llvm
lit.llvm.initialize(lit_config, config)