[clang] [clang] Register all LLVM targets in AllClangUnitTest main (PR #144428)
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 19 10:19:03 PDT 2025
================
@@ -117,6 +117,7 @@ get_property(LINK_LIBS GLOBAL PROPERTY CLANG_UNITTEST_LINK_LIBS)
get_property(LLVM_COMPONENTS GLOBAL PROPERTY CLANG_UNITTEST_LLVM_COMPONENTS)
add_distinct_clang_unittest(AllClangUnitTests
${SRCS}
+ AllClangUnitTests.cpp
----------------
rnk wrote:
Yeah, on second thought, there's a lot more going on in UnitTestMain than I thought. I rewrote this to use a dynamic initializer to register the targets instead. Those will reliably run before test fixtures. The only risk here is that we encounter intialization-order-fiasco issues, but I spot-checked x86, and it seems to be resilient to that... I will test with ASan locally to build confidence, but PTAL at the new approach.
https://github.com/llvm/llvm-project/pull/144428
More information about the cfe-commits
mailing list