summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cc36
1 files changed, 0 insertions, 36 deletions
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cc b/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cc
index d712eb6ce01..592d9c3eeaf 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cc
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cc
@@ -255,42 +255,6 @@ TEST(SanitizerCommon, LibraryNameIs) {
}
}
-static pthread_key_t key;
-static bool destructor_executed;
-
-extern "C"
-void destructor(void *arg) {
- uptr iter = reinterpret_cast<uptr>(arg);
- if (iter > 1) {
- ASSERT_EQ(0, pthread_setspecific(key, reinterpret_cast<void *>(iter - 1)));
- return;
- }
- destructor_executed = true;
-}
-
-extern "C"
-void *thread_func(void *arg) {
- return reinterpret_cast<void*>(pthread_setspecific(key, arg));
-}
-
-static void SpawnThread(uptr iteration) {
- destructor_executed = false;
- pthread_t tid;
- ASSERT_EQ(0, pthread_create(&tid, 0, &thread_func,
- reinterpret_cast<void *>(iteration)));
- void *retval;
- ASSERT_EQ(0, pthread_join(tid, &retval));
- ASSERT_EQ(0, retval);
-}
-
-TEST(SanitizerCommon, PthreadDestructorIterations) {
- ASSERT_EQ(0, pthread_key_create(&key, &destructor));
- SpawnThread(kPthreadDestructorIterations);
- EXPECT_TRUE(destructor_executed);
- SpawnThread(kPthreadDestructorIterations + 1);
- EXPECT_FALSE(destructor_executed);
-}
-
} // namespace __sanitizer
#endif // SANITIZER_LINUX
OpenPOWER on IntegriCloud