[PATCH] D101997: [lld] Add a feature for each lld variant when use_lld is called
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 17 02:58:25 PDT 2021
jhenderson updated this revision to Diff 345804.
jhenderson added a comment.
This revision is now accepted and ready to land.
Update test to not depend on D101995 <https://reviews.llvm.org/D101995>.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101997/new/
https://reviews.llvm.org/D101997
Files:
llvm/utils/lit/lit/llvm/config.py
llvm/utils/lit/tests/Inputs/lld-features/ld.lld
llvm/utils/lit/tests/Inputs/lld-features/ld.lld.exe
llvm/utils/lit/tests/Inputs/lld-features/ld.lld.txt
llvm/utils/lit/tests/Inputs/lld-features/ld64.lld
llvm/utils/lit/tests/Inputs/lld-features/ld64.lld.exe
llvm/utils/lit/tests/Inputs/lld-features/ld64.lld.txt
llvm/utils/lit/tests/Inputs/lld-features/lit.cfg
llvm/utils/lit/tests/Inputs/lld-features/lld-link
llvm/utils/lit/tests/Inputs/lld-features/lld-link.exe
llvm/utils/lit/tests/Inputs/lld-features/lld-link.txt
llvm/utils/lit/tests/Inputs/lld-features/wasm-ld
llvm/utils/lit/tests/Inputs/lld-features/wasm-ld.exe
llvm/utils/lit/tests/Inputs/lld-features/wasm-ld.txt
llvm/utils/lit/tests/lld-features.py
Index: llvm/utils/lit/tests/lld-features.py
===================================================================
--- /dev/null
+++ llvm/utils/lit/tests/lld-features.py
@@ -0,0 +1,6 @@
+## Show that each of the LLD variants detected by use_lld comes with its own
+## feature.
+
+# RUN: %{lit} %{inputs}/lld-features 2>&1 | FileCheck %s -DDIR=%p
+
+# CHECK: Passed: 4
Index: llvm/utils/lit/tests/Inputs/lld-features/wasm-ld.txt
===================================================================
--- /dev/null
+++ llvm/utils/lit/tests/Inputs/lld-features/wasm-ld.txt
@@ -0,0 +1,2 @@
+# REQUIRES: wasm-ld
+# RUN: true
Index: llvm/utils/lit/tests/Inputs/lld-features/lld-link.txt
===================================================================
--- /dev/null
+++ llvm/utils/lit/tests/Inputs/lld-features/lld-link.txt
@@ -0,0 +1,2 @@
+# REQUIRES: lld-link
+# RUN: true
Index: llvm/utils/lit/tests/Inputs/lld-features/lit.cfg
===================================================================
--- /dev/null
+++ llvm/utils/lit/tests/Inputs/lld-features/lit.cfg
@@ -0,0 +1,17 @@
+import lit.formats
+config.name = 'search-env'
+config.suffixes = ['.txt']
+config.test_format = lit.formats.ShTest()
+config.test_source_root = None
+config.test_exec_root = None
+config.llvm_tools_dir = ''
+import lit.llvm
+lit.llvm.initialize(lit_config, config)
+import os.path
+curdir = os.path.dirname(__file__)
+# The current directory contains files for each version of LLD, both with and
+# without a .exe extension. The .exe versions will be found on Windows and the
+# ones without will be found on Linux. Note that all files are just empty files,
+# since the test doesn't actually use them.
+lit.llvm.llvm_config.with_environment('PATH', curdir, append_path=True)
+lit.llvm.llvm_config.use_lld()
Index: llvm/utils/lit/tests/Inputs/lld-features/ld64.lld.txt
===================================================================
--- /dev/null
+++ llvm/utils/lit/tests/Inputs/lld-features/ld64.lld.txt
@@ -0,0 +1,2 @@
+# REQUIRES: ld64.lld
+# RUN: true
Index: llvm/utils/lit/tests/Inputs/lld-features/ld.lld.txt
===================================================================
--- /dev/null
+++ llvm/utils/lit/tests/Inputs/lld-features/ld.lld.txt
@@ -0,0 +1,2 @@
+# REQUIRES: ld.lld
+# RUN: true
Index: llvm/utils/lit/lit/llvm/config.py
===================================================================
--- llvm/utils/lit/lit/llvm/config.py
+++ llvm/utils/lit/lit/llvm/config.py
@@ -604,11 +604,16 @@
tool_substitutions = []
if ld_lld:
tool_substitutions.append(ToolSubst(r'ld\.lld', command=ld_lld))
+ self.config.available_features.add('ld.lld')
if lld_link:
tool_substitutions.append(ToolSubst('lld-link', command=lld_link))
+ self.config.available_features.add('lld-link')
if ld64_lld:
tool_substitutions.append(ToolSubst(r'ld64\.lld', command=ld64_lld))
+ self.config.available_features.add('ld64.lld')
if wasm_ld:
tool_substitutions.append(ToolSubst('wasm-ld', command=wasm_ld))
+ self.config.available_features.add('wasm-ld')
self.add_tool_substitutions(tool_substitutions)
+
return was_found
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101997.345804.patch
Type: text/x-patch
Size: 3247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210517/cf062d32/attachment.bin>
More information about the llvm-commits
mailing list