From 0c2796dc3660faac2e36c2aa8b13e5cf493c1708 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 14 Dec 2016 16:20:22 +0000 Subject: [PATCH] Disable libLTO tests when libLTO is not built Summary: The current test only checks whether ld64 is available, causing tests to fail when ld64 is avilable but libLTO is not built. Reviewers: beanz, mehdi_amini Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D27739 llvm-svn: 289662 --- llvm/test/lit.cfg | 4 ++-- llvm/test/lit.site.cfg.in | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm/test/lit.cfg b/llvm/test/lit.cfg index d8728b6..b572f25 100644 --- a/llvm/test/lit.cfg +++ b/llvm/test/lit.cfg @@ -420,7 +420,7 @@ if config.host_triple == config.target_triple: import subprocess def have_ld_plugin_support(): - if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'LLVMgold.so')): + if not config.llvm_tool_llvm_shlib_build: return False ld_cmd = subprocess.Popen([config.gold_executable, '--help'], stdout = subprocess.PIPE, env={'LANG': 'C'}) @@ -455,7 +455,7 @@ if have_ld_plugin_support(): config.available_features.add('ld_plugin') def have_ld64_plugin_support(): - if config.ld64_executable == '': + if (not config.llvm_tool_lto_build or config.ld64_executable == ''): return False ld_cmd = subprocess.Popen([config.ld64_executable, '-v'], stderr = subprocess.PIPE) diff --git a/llvm/test/lit.site.cfg.in b/llvm/test/lit.site.cfg.in index 1ce3df7..8b0a3a6 100644 --- a/llvm/test/lit.site.cfg.in +++ b/llvm/test/lit.site.cfg.in @@ -15,6 +15,8 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.python_executable = "@PYTHON_EXECUTABLE@" config.gold_executable = "@GOLD_EXECUTABLE@" config.ld64_executable = "@LD64_EXECUTABLE@" +config.llvm_tool_llvm_shlib_build = "@LLVM_TOOL_LLVM_SHLIB_BUILD@" +config.llvm_tool_lto_build = "@LLVM_TOOL_LTO_BUILD@" config.ocamlfind_executable = "@OCAMLFIND@" config.have_ocamlopt = "@HAVE_OCAMLOPT@" config.have_ocaml_ounit = "@HAVE_OCAML_OUNIT@" -- 2.7.4