tsan: add __has_feature(thread_sanitizer)
llvm-svn: 170314
diff --git a/clang/test/Lexer/has_feature_thread_sanitizer.cpp b/clang/test/Lexer/has_feature_thread_sanitizer.cpp
new file mode 100644
index 0000000..0a24810
--- /dev/null
+++ b/clang/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