diff options
Diffstat (limited to 'test/Lexer/has_feature_memory_sanitizer.cpp')
-rw-r--r-- | test/Lexer/has_feature_memory_sanitizer.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Lexer/has_feature_memory_sanitizer.cpp b/test/Lexer/has_feature_memory_sanitizer.cpp new file mode 100644 index 0000000..3ebb9e1 --- /dev/null +++ b/test/Lexer/has_feature_memory_sanitizer.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -E -fsanitize=memory %s -o - | FileCheck --check-prefix=CHECK-MSAN %s +// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-MSAN %s + +#if __has_feature(memory_sanitizer) +int MemorySanitizerEnabled(); +#else +int MemorySanitizerDisabled(); +#endif + +// CHECK-MSAN: MemorySanitizerEnabled +// CHECK-NO-MSAN: MemorySanitizerDisabled |