From a7bf226529c518806eca1601cf477b1f89b5ba75 Mon Sep 17 00:00:00 2001 From: Francis Ricci Date: Fri, 29 Sep 2017 16:51:50 +0000 Subject: [PATCH] [test] Enable LeakSanitizer on 64-bit Darwin ASan llvm builds Summary: Also disables leak checking on lto tests, due to many leaks reported in the system's ld64. Reviewers: kcc, pcc, bogner, kubamracek Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D37781 llvm-svn: 314535 --- llvm/test/tools/lto/lit.local.cfg | 6 +++++- llvm/utils/lit/lit/llvm/config.py | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/llvm/test/tools/lto/lit.local.cfg b/llvm/test/tools/lto/lit.local.cfg index 2176835..5ca293b 100644 --- a/llvm/test/tools/lto/lit.local.cfg +++ b/llvm/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' diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py index 174279c..c3bdef3 100644 --- a/llvm/utils/lit/lit/llvm/config.py +++ b/llvm/utils/lit/lit/llvm/config.py @@ -75,6 +75,9 @@ class LLVMConfig(object): features.add("long_tests") if target_triple: + if re.match(r'^x86_64.*-apple', target_triple): + if 'address' in sanitizers: + self.with_environment('ASAN_OPTIONS', 'detect_leaks=1', append_path=True) if re.match(r'^x86_64.*-linux', target_triple): features.add("x86_64-linux") if re.match(r'.*-win32$', target_triple): -- 2.7.4