summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/tests
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2012-11-28 12:19:50 +0000
committerDmitry Vyukov <dvyukov@google.com>2012-11-28 12:19:50 +0000
commite1a7f338a34f358b8866a7d08a21a1756e43f2da (patch)
treef22d56ebf846e7aae5f1aee51938b29140fbad5b /compiler-rt/lib/tsan/tests
parent3eb16c543e2cc3f0415012df03dc6189359d6f81 (diff)
downloadbcm5719-llvm-e1a7f338a34f358b8866a7d08a21a1756e43f2da.tar.gz
bcm5719-llvm-e1a7f338a34f358b8866a7d08a21a1756e43f2da.zip
tsan: dynamic history size
introduces history_size parameter that can be used to control trace size at startup llvm-svn: 168786
Diffstat (limited to 'compiler-rt/lib/tsan/tests')
-rw-r--r--compiler-rt/lib/tsan/tests/unit/tsan_shadow_test.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/lib/tsan/tests/unit/tsan_shadow_test.cc b/compiler-rt/lib/tsan/tests/unit/tsan_shadow_test.cc
index 3547eafe7a3..fa9c982c0f6 100644
--- a/compiler-rt/lib/tsan/tests/unit/tsan_shadow_test.cc
+++ b/compiler-rt/lib/tsan/tests/unit/tsan_shadow_test.cc
@@ -22,6 +22,7 @@ TEST(Shadow, FastState) {
EXPECT_EQ(s.epoch(), (u64)22);
EXPECT_EQ(s.GetIgnoreBit(), false);
EXPECT_EQ(s.GetFreedAndReset(), false);
+ EXPECT_EQ(s.GetHistorySize(), 0);
EXPECT_EQ(s.addr0(), (u64)0);
EXPECT_EQ(s.size(), (u64)1);
EXPECT_EQ(s.is_write(), false);
@@ -35,6 +36,14 @@ TEST(Shadow, FastState) {
EXPECT_EQ(s.GetIgnoreBit(), true);
s.ClearIgnoreBit();
EXPECT_EQ(s.GetIgnoreBit(), false);
+
+ for (int i = 0; i < 8; i++) {
+ s.SetHistorySize(i);
+ EXPECT_EQ(s.GetHistorySize(), i);
+ }
+ s.SetHistorySize(2);
+ s.ClearHistorySize();
+ EXPECT_EQ(s.GetHistorySize(), 0);
}
TEST(Shadow, Mapping) {
OpenPOWER on IntegriCloud