From: Vedant Kumar Date: Fri, 22 Sep 2017 18:42:28 +0000 (+0000) Subject: [lit.cfg] Avoid concatenating which(clang-func-mapping) if it's missing X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44655e1e708397b4b90d0b17810bc8882acea7b5;p=clang [lit.cfg] Avoid concatenating which(clang-func-mapping) if it's missing This un-breaks a lit workflow where you run lit tests from a test sub-directory within clang without first building clang-func-mapping. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314013 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/lit.cfg.py b/test/lit.cfg.py index 4f419f11e2..a600f2d9b8 100644 --- a/test/lit.cfg.py +++ b/test/lit.cfg.py @@ -125,7 +125,11 @@ config.substitutions.append( ('%clang_cl', ' ' + config.clang + ' --driver-mode=cl ')) config.substitutions.append( ('%clangxx', ' ' + config.clang + ' --driver-mode=g++ ')) -config.substitutions.append( ('%clang_func_map', ' ' + lit.util.which('clang-func-mapping', config.environment['PATH']) + ' ') ) + +clang_func_map = lit.util.which('clang-func-mapping', config.environment['PATH']) +if clang_func_map: + config.substitutions.append( ('%clang_func_map', ' ' + clang_func_map + ' ') ) + config.substitutions.append( ('%clang', ' ' + config.clang + ' ') ) config.substitutions.append( ('%test_debuginfo', ' ' + config.llvm_src_root + '/utils/test_debuginfo.pl ') )