[compiler-rt] r202480 - [sanitizer] a test for recursive rwlock and deadlock detector (currently fails)

Kostya Serebryany kcc at google.com
Fri Feb 28 02:03:51 PST 2014


Author: kcc
Date: Fri Feb 28 04:03:51 2014
New Revision: 202480

URL: http://llvm.org/viewvc/llvm-project?rev=202480&view=rev
Log:
[sanitizer] a test for recursive rwlock and deadlock detector (currently fails)

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=202480&r1=202479&r2=202480&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc (original)
+++ compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc Fri Feb 28 04:03:51 2014
@@ -400,6 +400,15 @@ class LockTest {
                &LockTest::CreateAndDestroyLocksLoop);
   }
 
+  void Test15() {
+    if (test_number > 0 && test_number != 15) return;
+    if (!LockType::supports_read_lock()) return;
+    fprintf(stderr, "Starting Test15: 4 threads read lock/unlock 4 shared mutexes, all under another shared mutex\n");
+    // DISABLEDCHECK-RD: Starting Test15
+    Init(5);
+    RL(0); RL(0); RU(0); RU(0);  // Recusrive reader lock.
+  }
+
  private:
   void Lock2(size_t l1, size_t l2) { L(l1); L(l2); U(l2); U(l1); }
   void Lock_0_1() { Lock2(0, 1); }
@@ -486,6 +495,7 @@ int main(int argc, char **argv) {
   LockTest().Test12();
   LockTest().Test13();
   LockTest().Test14();
+  // LockTest().Test15();  FIXME: this is broken for PthreadRWLock
   fprintf(stderr, "ALL-DONE\n");
   // CHECK: ALL-DONE
 }





More information about the llvm-commits mailing list