diff options
author | Kostya Serebryany <kcc@google.com> | 2014-02-19 14:24:31 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2014-02-19 14:24:31 +0000 |
commit | c3cc5874235791b680461b8d8d67e504cc460e11 (patch) | |
tree | f5e14b7c70118e435fcfd5c9a000d3ccb8da08df /test/tsan | |
parent | 53a29cf84b31c40e094cfa4eb8888f063012a91d (diff) | |
download | compiler-rt-c3cc5874235791b680461b8d8d67e504cc460e11.tar.gz |
[tsan] improve the test that checks for lock inversion with 3 locks
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tsan')
-rw-r--r-- | test/tsan/deadlock_detector_stress_test.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/tsan/deadlock_detector_stress_test.cc b/test/tsan/deadlock_detector_stress_test.cc index 30ce88d12..535ced7c6 100644 --- a/test/tsan/deadlock_detector_stress_test.cc +++ b/test/tsan/deadlock_detector_stress_test.cc @@ -57,9 +57,16 @@ class LockTest { void Test2() { fprintf(stderr, "Starting Test2\n"); // CHECK: Starting Test2 - L(0); L(1); L(2); U(2); U(0); U(1); + fprintf(stderr, "Expecting lock inversion: %p %p %p\n", A(0), A(1), A(2)); + // CHECK: Expecting lock inversion: [[A1:0x[a-f0-9]*]] [[A2:0x[a-f0-9]*]] [[A3:0x[a-f0-9]*]] + L(0); L(1); U(0); U(1); + L(1); L(2); U(1); U(2); L(2); L(0); U(0); U(2); // CHECK: WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) + // CHECK: path: [[M1:M[0-9]+]] => [[M2:M[0-9]+]] => [[M3:M[0-9]+]] => [[M1]] + // CHECK: Mutex [[M1]] ([[A1]]) created at: + // CHECK: Mutex [[M2]] ([[A2]]) created at: + // CHECK: Mutex [[M3]] ([[A3]]) created at: // CHECK-NOT: WARNING: ThreadSanitizer: } |