[cfe-commits] r170686 - in /cfe/trunk: lib/Lex/PPMacroExpansion.cpp test/Lexer/has_feature_memory_sanitizer.cpp
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Thu Dec 20 04:03:13 PST 2012
Author: eugenis
Date: Thu Dec 20 06:03:13 2012
New Revision: 170686
URL: http://llvm.org/viewvc/llvm-project?rev=170686&view=rev
Log:
Add __has_feature(memory_sanitizer).
Added:
cfe/trunk/test/Lexer/has_feature_memory_sanitizer.cpp (with props)
Modified:
cfe/trunk/lib/Lex/PPMacroExpansion.cpp
Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=170686&r1=170685&r2=170686&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Thu Dec 20 06:03:13 2012
@@ -780,6 +780,7 @@
.Case("cxx_exceptions", LangOpts.Exceptions)
.Case("cxx_rtti", LangOpts.RTTI)
.Case("enumerator_attributes", true)
+ .Case("memory_sanitizer", LangOpts.SanitizeMemory)
.Case("thread_sanitizer", LangOpts.SanitizeThread)
// Objective-C features
.Case("objc_arr", LangOpts.ObjCAutoRefCount) // FIXME: REMOVE?
Added: cfe/trunk/test/Lexer/has_feature_memory_sanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/has_feature_memory_sanitizer.cpp?rev=170686&view=auto
==============================================================================
--- cfe/trunk/test/Lexer/has_feature_memory_sanitizer.cpp (added)
+++ cfe/trunk/test/Lexer/has_feature_memory_sanitizer.cpp Thu Dec 20 06:03:13 2012
@@ -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
Propchange: cfe/trunk/test/Lexer/has_feature_memory_sanitizer.cpp
------------------------------------------------------------------------------
svn:eol-style = LF
More information about the cfe-commits
mailing list