[compiler-rt] r210370 - [TSan] Make lit-tests more self-contained
Alexey Samsonov
vonosmas at gmail.com
Fri Jun 6 14:04:55 PDT 2014
Author: samsonov
Date: Fri Jun 6 16:04:55 2014
New Revision: 210370
URL: http://llvm.org/viewvc/llvm-project?rev=210370&view=rev
Log:
[TSan] Make lit-tests more self-contained
Removed:
compiler-rt/trunk/test/tsan/Helpers/
compiler-rt/trunk/test/tsan/SharedLibs/
Modified:
compiler-rt/trunk/test/tsan/blacklist.cc
compiler-rt/trunk/test/tsan/blacklist2.cc
compiler-rt/trunk/test/tsan/load_shared_lib.cc
compiler-rt/trunk/test/tsan/mutex_cycle2.c
Modified: compiler-rt/trunk/test/tsan/blacklist.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/blacklist.cc?rev=210370&r1=210369&r2=210370&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/blacklist.cc (original)
+++ compiler-rt/trunk/test/tsan/blacklist.cc Fri Jun 6 16:04:55 2014
@@ -1,8 +1,7 @@
// Test blacklist functionality for TSan.
-// RUN: %clangxx_tsan -O1 %s \
-// RUN: -fsanitize-blacklist=%p/Helpers/blacklist.txt \
-// RUN: -o %t && %run %t 2>&1 | FileCheck %s
+// RUN: echo "fun:*Blacklisted_Thread2*" > %t.blacklist
+// RUN: %clangxx_tsan -O1 %s -fsanitize-blacklist=%t.blacklist -o %t && %run %t 2>&1 | FileCheck %s
#include <pthread.h>
#include <stdio.h>
Modified: compiler-rt/trunk/test/tsan/blacklist2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/blacklist2.cc?rev=210370&r1=210369&r2=210370&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/blacklist2.cc (original)
+++ compiler-rt/trunk/test/tsan/blacklist2.cc Fri Jun 6 16:04:55 2014
@@ -1,6 +1,9 @@
// Test that blacklisted functions are still contained in the stack trace.
-// RUN: %clangxx_tsan -O1 %s -fsanitize-blacklist=%p/Helpers/blacklist.txt -o %t
+// RUN: echo "fun:*Blacklisted_Thread2*" > %t.blacklist
+// RUN: echo "fun:*CallTouchGlobal*" >> %t.blacklist
+
+// RUN: %clangxx_tsan -O1 %s -fsanitize-blacklist=%t.blacklist -o %t
// RUN: %deflake %run %t 2>&1 | FileCheck %s
#include <pthread.h>
#include <stdio.h>
Modified: compiler-rt/trunk/test/tsan/load_shared_lib.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/load_shared_lib.cc?rev=210370&r1=210369&r2=210370&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/load_shared_lib.cc (original)
+++ compiler-rt/trunk/test/tsan/load_shared_lib.cc Fri Jun 6 16:04:55 2014
@@ -2,10 +2,26 @@
// reports, the second report occurring in a new shared library is still
// symbolized correctly.
-// RUN: %clangxx_tsan -O1 %p/SharedLibs/load_shared_lib-so.cc \
-// RUN: -fPIC -shared -o %t-so.so
+// RUN: %clangxx_tsan -O1 %s -DBUILD_SO -fPIC -shared -o %t-so.so
// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
+#ifdef BUILD_SO
+
+#include <stddef.h>
+#include <unistd.h>
+
+int GLOB_SHARED = 0;
+
+extern "C"
+void *write_from_so(void *unused) {
+ if (unused)
+ sleep(1);
+ GLOB_SHARED++;
+ return NULL;
+}
+
+#else // BUILD_SO
+
#include <dlfcn.h>
#include <pthread.h>
#include <stdio.h>
@@ -46,3 +62,5 @@ int main(int argc, char *argv[]) {
// CHECK: write_from_so
return 0;
}
+
+#endif // BUILD_SO
Modified: compiler-rt/trunk/test/tsan/mutex_cycle2.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mutex_cycle2.c?rev=210370&r1=210369&r2=210370&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/mutex_cycle2.c (original)
+++ compiler-rt/trunk/test/tsan/mutex_cycle2.c Fri Jun 6 16:04:55 2014
@@ -1,9 +1,9 @@
// RUN: %clangxx_tsan %s -o %t
// RUN: TSAN_OPTIONS=detect_deadlocks=1 not %run %t 2>&1 | FileCheck %s
-// RUN: echo "deadlock:main" > sup
-// RUN: TSAN_OPTIONS="detect_deadlocks=1 suppressions=sup" %run %t
-// RUN: echo "deadlock:zzzz" > sup
-// RUN: TSAN_OPTIONS="detect_deadlocks=1 suppressions=sup" not %run %t 2>&1 | FileCheck %s
+// RUN: echo "deadlock:main" > %t.sup
+// RUN: TSAN_OPTIONS="detect_deadlocks=1 suppressions=%t.sup" %run %t
+// RUN: echo "deadlock:zzzz" > %t.sup
+// RUN: TSAN_OPTIONS="detect_deadlocks=1 suppressions=%t.sup" not %run %t 2>&1 | FileCheck %s
#include <pthread.h>
int main() {
More information about the llvm-commits
mailing list