Skip to content

Commit c6f501d

Browse files
[XRay] Run tests inside bootstrapping build (#168378)
COMPILER_RT_STANDALONE_BUILD is set when doing a bootstrapping build through LLVM_ENABLE_RUNTIMES with the CMake source directory being in llvm/. This patch changes the XRay tests to also detect that we have LLVM sources and the llvm-xray tool if we are in a bootstrapping build through the use of the LLVM_TREE_AVAILABLE variable which is set in runtimes/CMakeLists.txt.
1 parent e27dec5 commit c6f501d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

compiler-rt/test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ pythonize_bool(COMPILER_RT_HAS_AARCH64_SME)
1616

1717
pythonize_bool(COMPILER_RT_HAS_NO_DEFAULT_CONFIG_FLAG)
1818

19+
if(LLVM_TREE_AVAILABLE OR NOT COMPILER_RT_STANDALONE_BUILD)
20+
set(COMPILER_RT_BUILT_WITH_LLVM TRUE)
21+
else()
22+
set(COMPILER_RT_BUILT_WITH_LLVM FALSE)
23+
endif()
24+
pythonize_bool(COMPILER_RT_BUILT_WITH_LLVM)
25+
1926
configure_compiler_rt_lit_site_cfg(
2027
${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in
2128
${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured)

compiler-rt/test/xray/lit.site.cfg.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ config.name_suffix = "@XRAY_TEST_CONFIG_SUFFIX@"
55
config.xray_lit_source_dir = "@XRAY_LIT_SOURCE_DIR@"
66
config.target_cflags = "@XRAY_TEST_TARGET_CFLAGS@"
77
config.target_arch = "@XRAY_TEST_TARGET_ARCH@"
8-
config.built_with_llvm = ("@COMPILER_RT_STANDALONE_BUILD@" != "TRUE")
8+
config.built_with_llvm = "@COMPILER_RT_BUILT_WITH_LLVM@"
99

1010
# TODO: Look into whether we can run a capability test on the standalone build to
1111
# see whether it can run 'llvm-xray convert' instead of turning off tests for a

0 commit comments

Comments
 (0)