summaryrefslogtreecommitdiff
path: root/lib/tsan/tests
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2014-03-17 07:51:53 +0000
committerDmitry Vyukov <dvyukov@google.com>2014-03-17 07:51:53 +0000
commit325895f4f452816f266fdee4d2ef17164ced6774 (patch)
tree923ab628497e60559e30a7fd7ccd7ef49769c679 /lib/tsan/tests
parentbeb3026bb0858e80f016e10b9e16680141728575 (diff)
tsan: yet another attempt to fix pthread_cond interceptors
Make behavior introduced in r202820 conditional (under legacy_pthread_cond flag). The new issue that we've hit with the satellite pthread_cond_t struct is that pthread_condattr_getpshared does not work (satellite data is not shared between processes). The idea is that most processes do not use pthread 2.2.5. The rare ones that use (2.2.5 is dated by 2002) must specify legacy_pthread_cond=1 on their own risk. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204032 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/tests')
-rw-r--r--lib/tsan/tests/unit/tsan_flags_test.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/tsan/tests/unit/tsan_flags_test.cc b/lib/tsan/tests/unit/tsan_flags_test.cc
index 36e3a49bf..33ddaaae2 100644
--- a/lib/tsan/tests/unit/tsan_flags_test.cc
+++ b/lib/tsan/tests/unit/tsan_flags_test.cc
@@ -75,6 +75,7 @@ static const char *options1 =
" leak_check_at_exit=0"
" allocator_may_return_null=0"
" print_summary=0"
+ " legacy_pthread_cond=0"
"";
static const char *options2 =
@@ -118,6 +119,7 @@ static const char *options2 =
" leak_check_at_exit=true"
" allocator_may_return_null=true"
" print_summary=true"
+ " legacy_pthread_cond=true"
"";
void VerifyOptions1(Flags *f) {
@@ -161,6 +163,7 @@ void VerifyOptions1(Flags *f) {
EXPECT_EQ(f->leak_check_at_exit, 0);
EXPECT_EQ(f->allocator_may_return_null, 0);
EXPECT_EQ(f->print_summary, 0);
+ EXPECT_EQ(f->legacy_pthread_cond, false);
}
void VerifyOptions2(Flags *f) {
@@ -204,6 +207,7 @@ void VerifyOptions2(Flags *f) {
EXPECT_EQ(f->leak_check_at_exit, true);
EXPECT_EQ(f->allocator_may_return_null, true);
EXPECT_EQ(f->print_summary, true);
+ EXPECT_EQ(f->legacy_pthread_cond, true);
}
static const char *test_default_options;