ASan doesn't play well with -D_FORTIFY_SOURCE, which is enabled by default starting at OS X 10.7
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164299
91177308-0d34-0410-b5e6-
96231b3b80d8
Builder.defineMacro("__APPLE__");
Builder.defineMacro("__MACH__");
Builder.defineMacro("OBJC_NEW_PROPERTIES");
+ // AddressSanitizer doesn't play well with source fortification, which is on
+ // by default on Darwin.
+ if (Opts.AddressSanitizer) Builder.defineMacro("_FORTIFY_SOURCE", "0");
if (!Opts.ObjCAutoRefCount) {
// __weak is always defined, for use in blocks and with objc pointers.
--- /dev/null
+// Make sure AddressSanitizer disables _FORTIFY_SOURCE on Darwin.
+
+// REQUIRES: system-darwin
+// RUN: %clang -faddress-sanitizer %s -E -dM -o - | FileCheck %s
+// CHECK: #define _FORTIFY_SOURCE 0
if platform.system() not in ['Windows'] or lit.getBashPath() != '':
config.available_features.add('shell')
+# For tests that require Darwin to run.
+if platform.system() in ['Darwin']:
+ config.available_features.add('system-darwin')
+
# ANSI escape sequences in non-dumb terminal
if platform.system() not in ['Windows']:
config.available_features.add('ansi-escape-sequences')