llvm-project/lldb/test/Shell/Expr
Pavel Labath 9c73925226 [lldb/lit] Introduce %clang_host substitutions
Summary:
This patch addresses an ambiguity in how our existing tests invoke the
compiler. Roughly two thirds of our current "shell" tests invoke the
compiler to build the executables for the host. However, there is also
a significant number of tests which don't build a host binary (because
they don't need to run it) and instead they hardcode a certain target.

We also have code which adds a bunch of default arguments to the %clang
substitutions. However, most of these arguments only really make sense
for the host compilation. So far, this has worked mostly ok, because the
arguments we were adding were not conflicting with the target-hardcoding
tests (though they did provoke an occasional "argument unused" warning).

However, this started to break down when we wanted to use
target-hardcoding clang-cl tests (D69031) because clang-cl has a
substantially different command line, and it was getting very confused
by some of the arguments we were adding on non-windows hosts.

This patch avoid this problem by creating separate %clang(xx,_cl)_host
substutitions, which are specifically meant to be used for compiling
host binaries. All funny host-specific options are moved there. To
ensure that the regular %clang substitutions are not used for compiling
host binaries (skipping the extra arguments) I employ a little
hac^H^H^Htrick -- I add an invalid --target argument to the %clang
substitution, which means that one has to use an explicit --target in
order for the compilation to succeed.

Reviewers: JDevlieghere, aprantl, mstorsjo, espindola

Subscribers: emaste, arichardson, MaskRay, jfb, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D69619
2019-10-31 10:40:37 +01:00
..
Inputs Re-land "[test] Split LLDB tests into API, Shell & Unit" 2019-10-09 19:22:02 +00:00
TestIRMemoryMap.test [lldb/lit] Introduce %clang_host substitutions 2019-10-31 10:40:37 +01:00
TestIRMemoryMapWindows.test [lldb/lit] Introduce %clang_host substitutions 2019-10-31 10:40:37 +01:00
TestMultilineExpr.test Re-land "[test] Split LLDB tests into API, Shell & Unit" 2019-10-09 19:22:02 +00:00
TestTypeOfDeclTypeExpr.test Re-land "[test] Split LLDB tests into API, Shell & Unit" 2019-10-09 19:22:02 +00:00