mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
[lld] Add a feature for each lld variant when use_lld is called
This allows tests to detect whether to run or not, dependent on which LLD version is required for the test. Reviewed by: thopre Differential Revision: https://reviews.llvm.org/D101997
This commit is contained in:
parent
83804e2bc6
commit
2366a60fe0
@ -615,11 +615,16 @@ class LLVMConfig(object):
|
||||
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
|
||||
|
0
utils/lit/tests/Inputs/lld-features/ld.lld
Normal file
0
utils/lit/tests/Inputs/lld-features/ld.lld
Normal file
0
utils/lit/tests/Inputs/lld-features/ld.lld.exe
Normal file
0
utils/lit/tests/Inputs/lld-features/ld.lld.exe
Normal file
2
utils/lit/tests/Inputs/lld-features/ld.lld.txt
Normal file
2
utils/lit/tests/Inputs/lld-features/ld.lld.txt
Normal file
@ -0,0 +1,2 @@
|
||||
# REQUIRES: ld.lld
|
||||
# RUN: true
|
0
utils/lit/tests/Inputs/lld-features/ld64.lld
Normal file
0
utils/lit/tests/Inputs/lld-features/ld64.lld
Normal file
0
utils/lit/tests/Inputs/lld-features/ld64.lld.exe
Normal file
0
utils/lit/tests/Inputs/lld-features/ld64.lld.exe
Normal file
2
utils/lit/tests/Inputs/lld-features/ld64.lld.txt
Normal file
2
utils/lit/tests/Inputs/lld-features/ld64.lld.txt
Normal file
@ -0,0 +1,2 @@
|
||||
# REQUIRES: ld64.lld
|
||||
# RUN: true
|
17
utils/lit/tests/Inputs/lld-features/lit.cfg
Normal file
17
utils/lit/tests/Inputs/lld-features/lit.cfg
Normal file
@ -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(use_installed=True)
|
0
utils/lit/tests/Inputs/lld-features/lld-link
Normal file
0
utils/lit/tests/Inputs/lld-features/lld-link
Normal file
0
utils/lit/tests/Inputs/lld-features/lld-link.exe
Normal file
0
utils/lit/tests/Inputs/lld-features/lld-link.exe
Normal file
2
utils/lit/tests/Inputs/lld-features/lld-link.txt
Normal file
2
utils/lit/tests/Inputs/lld-features/lld-link.txt
Normal file
@ -0,0 +1,2 @@
|
||||
# REQUIRES: lld-link
|
||||
# RUN: true
|
0
utils/lit/tests/Inputs/lld-features/wasm-ld
Normal file
0
utils/lit/tests/Inputs/lld-features/wasm-ld
Normal file
0
utils/lit/tests/Inputs/lld-features/wasm-ld.exe
Normal file
0
utils/lit/tests/Inputs/lld-features/wasm-ld.exe
Normal file
2
utils/lit/tests/Inputs/lld-features/wasm-ld.txt
Normal file
2
utils/lit/tests/Inputs/lld-features/wasm-ld.txt
Normal file
@ -0,0 +1,2 @@
|
||||
# REQUIRES: wasm-ld
|
||||
# RUN: true
|
6
utils/lit/tests/lld-features.py
Normal file
6
utils/lit/tests/lld-features.py
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user