diff options
author | Pavel Labath <pavel@labath.sk> | 2019-10-30 15:57:16 +0100 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-10-31 10:40:37 +0100 |
commit | 9c739252261ea762d1bbbd8234d93c9038711fcd (patch) | |
tree | 67566285d8632debaecf25dbc79a24ff01555413 /lldb/test/Shell/Reproducer/Functionalities | |
parent | a7aee6c47a1b12dd7d579b4f98d7049eb1e987ce (diff) | |
download | bcm5719-llvm-9c739252261ea762d1bbbd8234d93c9038711fcd.tar.gz bcm5719-llvm-9c739252261ea762d1bbbd8234d93c9038711fcd.zip |
[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
Diffstat (limited to 'lldb/test/Shell/Reproducer/Functionalities')
3 files changed, 3 insertions, 3 deletions
diff --git a/lldb/test/Shell/Reproducer/Functionalities/TestDataFormatter.test b/lldb/test/Shell/Reproducer/Functionalities/TestDataFormatter.test index 8ee181e8035..7db8bc4b36c 100644 --- a/lldb/test/Shell/Reproducer/Functionalities/TestDataFormatter.test +++ b/lldb/test/Shell/Reproducer/Functionalities/TestDataFormatter.test @@ -3,7 +3,7 @@ # This tests that data formatters continue to work when replaying a reproducer. # RUN: rm -rf %t.repro -# RUN: %clangxx %S/Inputs/foo.cpp -g -o %t.out +# RUN: %clangxx_host %S/Inputs/foo.cpp -g -o %t.out # RUN: %lldb -x -b -s %S/Inputs/DataFormatter.in --capture --capture-path %t.repro %t.out | FileCheck %s # RUN: %lldb --replay %t.repro | FileCheck %s diff --git a/lldb/test/Shell/Reproducer/Functionalities/TestImageList.test b/lldb/test/Shell/Reproducer/Functionalities/TestImageList.test index d0abae164f0..db319093f17 100644 --- a/lldb/test/Shell/Reproducer/Functionalities/TestImageList.test +++ b/lldb/test/Shell/Reproducer/Functionalities/TestImageList.test @@ -3,7 +3,7 @@ # This tests that image list works when replaying. We arbitrarily assume # there's at least two entries and compare that they're identical. -# RUN: %clang %S/Inputs/stepping.c -g -o %t.out +# RUN: %clang_host %S/Inputs/stepping.c -g -o %t.out # RUN: rm -rf %t.txt diff --git a/lldb/test/Shell/Reproducer/Functionalities/TestStepping.test b/lldb/test/Shell/Reproducer/Functionalities/TestStepping.test index f43680f3e22..1dec9a077c7 100644 --- a/lldb/test/Shell/Reproducer/Functionalities/TestStepping.test +++ b/lldb/test/Shell/Reproducer/Functionalities/TestStepping.test @@ -3,7 +3,7 @@ # This tests that stepping continues to work when replaying a reproducer. # RUN: rm -rf %t.repro -# RUN: %clang %S/Inputs/stepping.c -O0 -g -o %t.out +# RUN: %clang_host %S/Inputs/stepping.c -O0 -g -o %t.out # RUN: grep -v '#' %s > %t.in # RUN: %lldb -x -b -s %t.in --capture --capture-path %t.repro %t.out | FileCheck %s --check-prefix CHECK |