diff --git a/compiler-rt/lib/gwp_asan/tests/late_init.cpp b/compiler-rt/lib/gwp_asan/tests/late_init.cpp --- a/compiler-rt/lib/gwp_asan/tests/late_init.cpp +++ b/compiler-rt/lib/gwp_asan/tests/late_init.cpp @@ -10,7 +10,9 @@ #include "gwp_asan/options.h" #include "gwp_asan/tests/harness.h" -TEST(LateInit, CheckLateInitIsOK) { +#include + +static void checkLateInitIsOK() { gwp_asan::GuardedPoolAllocator GPA; for (size_t i = 0; i < 0x100; ++i) @@ -23,3 +25,8 @@ GPA.init(Opts); EXPECT_TRUE(GPA.shouldSample()); } + +TEST(LateInit, CheckLateInitIsOK) { + std::thread Thread(checkLateInitIsOK); + Thread.join(); +}