diff options
Diffstat (limited to 'lib/tsan/tests/rtl/tsan_posix.cc')
-rw-r--r-- | lib/tsan/tests/rtl/tsan_posix.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/tsan/tests/rtl/tsan_posix.cc b/lib/tsan/tests/rtl/tsan_posix.cc index 0caedd7207e63..e1a61b5e43f1b 100644 --- a/lib/tsan/tests/rtl/tsan_posix.cc +++ b/lib/tsan/tests/rtl/tsan_posix.cc @@ -35,7 +35,7 @@ static void thread_secific_dtor(void *v) { __tsan_write4(&k->cnt); EXPECT_EQ(pthread_mutex_unlock(k->mtx), 0); if (k->val == 42) { - delete k; + // Okay. } else if (k->val == 43 || k->val == 44) { k->val--; EXPECT_EQ(pthread_setspecific(k->key, k), 0); @@ -57,20 +57,20 @@ TEST(Posix, ThreadSpecificDtors) { pthread_mutex_t mtx; EXPECT_EQ(pthread_mutex_init(&mtx, 0), 0); pthread_t th[3]; - thread_key *k[3]; - k[0] = new thread_key(key, &mtx, 42, &cnt); - k[1] = new thread_key(key, &mtx, 43, &cnt); - k[2] = new thread_key(key, &mtx, 44, &cnt); - EXPECT_EQ(pthread_create(&th[0], 0, dtors_thread, k[0]), 0); - EXPECT_EQ(pthread_create(&th[1], 0, dtors_thread, k[1]), 0); + thread_key k1 = thread_key(key, &mtx, 42, &cnt); + thread_key k2 = thread_key(key, &mtx, 43, &cnt); + thread_key k3 = thread_key(key, &mtx, 44, &cnt); + EXPECT_EQ(pthread_create(&th[0], 0, dtors_thread, &k1), 0); + EXPECT_EQ(pthread_create(&th[1], 0, dtors_thread, &k2), 0); EXPECT_EQ(pthread_join(th[0], 0), 0); - EXPECT_EQ(pthread_create(&th[2], 0, dtors_thread, k[2]), 0); + EXPECT_EQ(pthread_create(&th[2], 0, dtors_thread, &k3), 0); EXPECT_EQ(pthread_join(th[1], 0), 0); EXPECT_EQ(pthread_join(th[2], 0), 0); EXPECT_EQ(pthread_key_delete(key), 0); EXPECT_EQ(6, cnt); } +#ifndef __aarch64__ static __thread int local_var; static void *local_thread(void *p) { @@ -87,9 +87,14 @@ static void *local_thread(void *p) { EXPECT_EQ(pthread_join(th[i], 0), 0); return 0; } +#endif TEST(Posix, ThreadLocalAccesses) { +// The test is failing with high thread count for aarch64. +// FIXME: track down the issue and re-enable the test. +#ifndef __aarch64__ local_thread((void*)2); +#endif } struct CondContext { |