+++ /dev/null
-fun:*Blacklisted_Thread2*
-fun:*CallTouchGlobal*
+++ /dev/null
-# Files in this directory are helper files for other output tests.
-config.suffixes = []
+++ /dev/null
-# Sources in this directory are compiled as shared libraries and used by
-# tests in parent directory.
-
-config.suffixes = []
+++ /dev/null
-//===----------- load_shared_lib-so.cc --------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file is a part of ThreadSanitizer (TSan), a race detector.
-//
-//===----------------------------------------------------------------------===//
-
-#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;
-}
// 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>
// 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>
// 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>
// CHECK: write_from_so
return 0;
}
+
+#endif // BUILD_SO
// 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() {