[PATCH] D37781: [test] Enable LeakSanitizer on 64-bit Darwin ASan llvm builds
Francis Ricci via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 12 16:52:28 PDT 2017
fjricci created this revision.
Herald added a subscriber: mehdi_amini.
Also disables leak checking on lto tests, due to many leaks reported
in the system's ld64.
https://reviews.llvm.org/D37781
Files:
test/lit.cfg
test/tools/lto/lit.local.cfg
Index: test/tools/lto/lit.local.cfg
===================================================================
--- test/tools/lto/lit.local.cfg
+++ test/tools/lto/lit.local.cfg
@@ -1,2 +1,6 @@
if not ('ld64_plugin' in config.available_features and 'X86' in config.root.targets):
- config.unsupported = True
+ config.unsupported = True
+
+# These tests invoke ld64 from the system, which is not leak-free
+if "Address" in config.llvm_use_sanitizer:
+ config.environment['ASAN_OPTIONS'] = 'detect_leaks=0'
Index: test/lit.cfg
===================================================================
--- test/lit.cfg
+++ test/lit.cfg
@@ -389,6 +389,9 @@
# Sanitizers.
if 'Address' in config.llvm_use_sanitizer:
config.available_features.add("asan")
+ # LeakSanitizer is disabled by default on Darwin, enable it on 64-bit builds
+ if re.match(r'^x86_64-apple.*', config.target_triple):
+ config.environment['ASAN_OPTIONS'] = 'detect_leaks=1'
else:
config.available_features.add("not_asan")
if 'Memory' in config.llvm_use_sanitizer:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37781.114940.patch
Type: text/x-patch
Size: 1052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170912/33c7dee4/attachment.bin>
More information about the llvm-commits
mailing list