diff --git a/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors.cpp b/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors.cpp index 0eeaf9da67098..1ef4c66a28de8 100644 --- a/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors.cpp +++ b/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors.cpp @@ -472,11 +472,12 @@ TEST_F(PthreadMutexLockTest, PthreadMutexUnlockSurvivesWhenNotRealtime) { ExpectNonRealtimeSurvival(Func); } -TEST(TestRtsanInterceptors, PthreadMutexJoinDiesWhenRealtime) { - auto Func = []() { - pthread_t thread{}; - pthread_join(thread, nullptr); - }; +TEST(TestRtsanInterceptors, PthreadJoinDiesWhenRealtime) { + pthread_t thread{}; + ASSERT_EQ(0, + pthread_create(&thread, nullptr, &FakeThreadEntryPoint, nullptr)); + + auto Func = [&thread]() { pthread_join(thread, nullptr); }; ExpectRealtimeDeath(Func, "pthread_join"); ExpectNonRealtimeSurvival(Func);