summaryrefslogtreecommitdiffstats
path: root/clang/test/Lexer/has_feature_thread_sanitizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Lexer/has_feature_thread_sanitizer.cpp')
-rw-r--r--clang/test/Lexer/has_feature_thread_sanitizer.cpp11
1 files changed, 11 insertions, 0 deletions
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 00000000000..0a248100c87
--- /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
OpenPOWER on IntegriCloud