diff --git a/llvm/test/lit.cfg b/llvm/test/lit.cfg index 8ee2078b696eb8b2bfbd227617a11210359e0427..ce9ff1147cc3069c3e0f7b86327312b9707cbc4c 100644 --- a/llvm/test/lit.cfg +++ b/llvm/test/lit.cfg @@ -256,6 +256,13 @@ if loadable_module: if config.lto_is_enabled == "1" and platform.system() == "Darwin": config.available_features.add('lto_on_osx') +# Sanitizers. +if config.llvm_use_sanitizer == "Address": + config.available_features.add("asan") +if (config.llvm_use_sanitizer == "Memory" or + config.llvm_use_sanitizer == "MemoryWithOrigins"): + config.available_features.add("msan") + # llc knows whether he is compiled with -DNDEBUG. import subprocess try: diff --git a/llvm/test/lit.site.cfg.in b/llvm/test/lit.site.cfg.in index bfd901a0797b0b96c477120dd2bd98b0d35ccaf4..8024b24fcde75171d2e3c09f8b516a0aca2e0f2d 100644 --- a/llvm/test/lit.site.cfg.in +++ b/llvm/test/lit.site.cfg.in @@ -18,6 +18,7 @@ config.llvm_bindings = "@LLVM_BINDINGS@" config.host_os = "@HOST_OS@" config.host_arch = "@HOST_ARCH@" config.llvm_use_intel_jitevents = "@LLVM_USE_INTEL_JITEVENTS@" +config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" # Support substitution of the tools_dir with user parameters. This is # used when we can't determine the tool dir at configuration time.