diff options
Diffstat (limited to 'test/Lexer/has_feature_thread_sanitizer.cpp')
-rw-r--r-- | test/Lexer/has_feature_thread_sanitizer.cpp | 11 |
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 0000000..0a24810 --- /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 |