diff --git a/compiler-rt/test/lsan/lit.common.cfg.py b/compiler-rt/test/lsan/lit.common.cfg.py --- a/compiler-rt/test/lsan/lit.common.cfg.py +++ b/compiler-rt/test/lsan/lit.common.cfg.py @@ -34,7 +34,7 @@ config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix)) elif lsan_lit_test_mode == "HWAddressSanitizer": config.name = "LeakSanitizer-HWAddressSanitizer" - lsan_cflags = ["-fsanitize=hwaddress"] + lsan_cflags = ["-fsanitize=hwaddress", "-fuse-ld=lld"] if target_arch == "x86_64": lsan_cflags = lsan_cflags + [ '-fsanitize-hwaddress-experimental-aliasing'] config.available_features.add('hwasan') @@ -98,4 +98,8 @@ if re.search('mthumb', config.target_cflags) is not None: config.unsupported = True +# HWASAN tests require lld. Mark them unsupported if lld is not available. +if 'hwasan' in config.available_features and not config.has_lld: + config.unsupported = True + config.suffixes = ['.c', '.cpp', '.mm']