summaryrefslogtreecommitdiff
path: root/test/tsan/atomic_free.cc
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2016-11-11 23:17:49 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2016-11-11 23:17:49 +0000
commit7865e1cff308922ad06f3ac7916f061a64a2e313 (patch)
tree0a70c26a2042a522a6ce7173716e3d8020f44e0f /test/tsan/atomic_free.cc
parent7dc571ae0f1f271b19d92d9f9b1df9d47b173bc3 (diff)
Tread TSan LLVM flags to driver: unit tests.
Summary: Unit tests for the new clang flags. Reviewers: eugenis, dvyukov Subscribers: kubabrecka, llvm-commits Patch by Alex Shlyapnikov. Differential Revision: https://reviews.llvm.org/D26462 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@286670 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tsan/atomic_free.cc')
-rw-r--r--test/tsan/atomic_free.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/tsan/atomic_free.cc b/test/tsan/atomic_free.cc
index a0d8e426b..c1b04ef3f 100644
--- a/test/tsan/atomic_free.cc
+++ b/test/tsan/atomic_free.cc
@@ -1,4 +1,13 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
+// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
+
+// Also check that atomics instrumentation can be configured by either driver or
+// legacy flags:
+
+// RUN: %clangxx_tsan -O1 %s -o %t -fno-sanitize-thread-atomics && not %deflake %run %t 2>&1 \
+// RUN: | FileCheck --allow-empty --check-prefix=CHECK-NO-ATOMICS %s
+// RUN: %clangxx_tsan -O1 %s -o %t -mllvm -tsan-instrument-atomics=0 && not %deflake %run %t 2>&1 \
+// RUN: | FileCheck --allow-empty --check-prefix=CHECK-NO-ATOMICS %s <%t.out
+
#include "test.h"
void *Thread(void *a) {
@@ -18,3 +27,5 @@ int main() {
}
// CHECK: WARNING: ThreadSanitizer: data race
+
+// CHECK-NO-ATOMICS-NOT: WARNING: ThreadSanitizer: data race