xref: /llvm-project/compiler-rt/test/ctx_profile/Unit/lit.site.cfg.py.in (revision eb4a510283bdbf1e6f0b47a9e20ea88b775c5a85)
1@LIT_SITE_CFG_IN_HEADER@
2
3import os
4import platform
5import re
6import shlex
7
8# Load common config for all compiler-rt unit tests.
9lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
10
11# Setup config name.
12config.name = 'CtxProfile-Unit'
13config.target_arch = "@arch@"
14assert config.target_arch == 'x86_64'
15
16config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@",
17                                     "lib", "ctx_profile", "tests")
18
19config.test_source_root = config.test_exec_root
20
21# When LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on, the initial value of
22# config.compiler_rt_libdir (COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR) has the
23# host triple as the trailing path component. The value is incorrect for i386
24# tests on x86_64 hosts and vice versa. But, since only x86_64 is enabled as
25# target, and we don't support different environments for building and,
26# respectively, running tests, we we only need to fix up the x86_64 case.
27if config.enable_per_target_runtime_dir and config.target_arch != config.host_arch:
28    config.compiler_rt_libdir = re.sub(r'/i386(?=-[^/]+$)', '/x86_64', config.compiler_rt_libdir)
29