Skip to content

Commit f927106

Browse files
committed
[BOLT][test] Enable cross-target testing
Check for supported target architecture instead of the host arch when deciding to execute non-runtime tests. Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D122498
1 parent f0f5d19 commit f927106

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

bolt/test/AArch64/lit.local.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if config.host_arch not in ['aarch64']:
1+
if 'AArch64' not in config.root.targets:
22
config.unsupported = True
33

44
config.substitutions.insert(

bolt/test/X86/lit.local.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if config.host_arch not in ['x86', 'X86', 'x86_64']:
1+
if not 'X86' in config.root.targets:
22
config.unsupported = True
33

44
config.substitutions.insert(

bolt/test/lit.cfg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,5 @@ def calculate_arch_features(arch_string):
102102
('--cxxflags', {r'-D_GLIBCXX_DEBUG\b': 'libstdcxx-safe-mode'}),
103103
('--targets-built', calculate_arch_features)
104104
])
105+
106+
config.targets = frozenset(config.targets_to_build.split())

bolt/test/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ config.enable_abi_breaking_checks = "@LLVM_ENABLE_ABI_BREAKING_CHECKS@"
2121
config.python_executable = "@PYTHON_EXECUTABLE@"
2222
config.bolt_clang = "@BOLT_CLANG_EXE@"
2323
config.bolt_lld = "@BOLT_LLD_EXE@"
24+
config.targets_to_build = "@TARGETS_TO_BUILD@"
2425

2526
import lit.llvm
2627
lit.llvm.initialize(lit_config, config)

0 commit comments

Comments
 (0)