aboutsummaryrefslogtreecommitdiff
path: root/test/Lexer
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2012-12-17 08:52:05 +0000
committerDmitry Vyukov <dvyukov@google.com>2012-12-17 08:52:05 +0000
commit728e2127e858611750d560ee7692c322a8570faa (patch)
treee894d764b45dc674c9dfff3232202bb3cdcc39ea /test/Lexer
parentc092cbab26ee4e2875a5d99d7d9ad16b25e8f36d (diff)
tsan: add __has_feature(thread_sanitizer)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170314 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Lexer')
-rw-r--r--test/Lexer/has_feature_thread_sanitizer.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Lexer/has_feature_thread_sanitizer.cpp b/test/Lexer/has_feature_thread_sanitizer.cpp
new file mode 100644
index 0000000000..0a248100c8
--- /dev/null
+++ b/test/Lexer/has_feature_thread_sanitizer.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -E -fsanitize=thread %s -o - | FileCheck --check-prefix=CHECK-TSAN %s
+// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-TSAN %s
+
+#if __has_feature(thread_sanitizer)
+int ThreadSanitizerEnabled();
+#else
+int ThreadSanitizerDisabled();
+#endif
+
+// CHECK-TSAN: ThreadSanitizerEnabled
+// CHECK-NO-TSAN: ThreadSanitizerDisabled