[compiler-rt] r201676 - [tsan] improve the test that checks for lock inversion with 3 locks

Kostya Serebryany kcc at google.com
Wed Feb 19 06:24:31 PST 2014


Author: kcc
Date: Wed Feb 19 08:24:31 2014
New Revision: 201676

URL: http://llvm.org/viewvc/llvm-project?rev=201676&view=rev
Log:
[tsan] improve the test that checks for lock inversion with 3 locks

Modified:
    compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc

Modified: compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc?rev=201676&r1=201675&r2=201676&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc (original)
+++ compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc Wed Feb 19 08:24:31 2014
@@ -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:
   }
 





More information about the llvm-commits mailing list