summaryrefslogtreecommitdiff
path: root/test/tsan/deadlock_detector_stress_test.cc
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2014-02-18 14:56:19 +0000
committerKostya Serebryany <kcc@google.com>2014-02-18 14:56:19 +0000
commit42e50b8071b803a440b39d6b2767b4c5e7a80aa8 (patch)
tree3eb2cddbc6bd5e4be1c9472c1075479b9dad19b1 /test/tsan/deadlock_detector_stress_test.cc
parenta52e2dc237ebe66e0ee014cf44ed8e562ceb3f88 (diff)
[sanitizer] when reporting a deadlock also report the lock cycle
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tsan/deadlock_detector_stress_test.cc')
-rw-r--r--test/tsan/deadlock_detector_stress_test.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/tsan/deadlock_detector_stress_test.cc b/test/tsan/deadlock_detector_stress_test.cc
index 9c83f2d65..f36935ffd 100644
--- a/test/tsan/deadlock_detector_stress_test.cc
+++ b/test/tsan/deadlock_detector_stress_test.cc
@@ -33,13 +33,21 @@ class LockTest {
locks_[i].unlock();
}
+ void *A(size_t i) {
+ assert(i < n_);
+ return &locks_[i];
+ }
+
// Simple lock order onversion.
void Test1() {
fprintf(stderr, "Starting Test1\n");
// CHECK: Starting Test1
+ fprintf(stderr, "Expecting lock inversion: %p %p\n", A(0), A(1));
+ // CHECK: Expecting lock inversion: [[A1:0x[a-f0-9]*]] [[A2:0x[a-f0-9]*]]
L(0); L(1); U(0); U(1);
L(1); L(0); U(0); U(1);
// CHECK: ThreadSanitizer: lock-order-inversion (potential deadlock)
+ // CHECK-NEXT: path: [[A1]] => [[A2]] => [[A1]]
// CHECK-NOT: ThreadSanitizer:
}