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 | |
| 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')
10 files changed, 10 insertions, 10 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 diff --git a/lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test b/lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test index 843c7e6d1ff..67a11d4539f 100644 --- a/lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test +++ b/lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test @@ -16,7 +16,7 @@ # RUN: cp %S/Inputs/module.modulemap %t.root # Compile the test case form the temporary root. -# RUN: %clang %t.root/main.cpp -g -fmodules -fcxx-modules -fmodules-cache-path=%t.clang-cache -o %t.root/a.out +# RUN: %clang_host %t.root/main.cpp -g -fmodules -fcxx-modules -fmodules-cache-path=%t.clang-cache -o %t.root/a.out # Capture the debug session. # RUN: %lldb -x -b -o 'settings set symbols.clang-modules-cache-path %t.lldb-cache' -s %S/Inputs/ModuleCXX.in --capture --capture-path %t.repro %t.root/a.out | FileCheck %s --check-prefix CAPTURE diff --git a/lldb/test/Shell/Reproducer/TestDump.test b/lldb/test/Shell/Reproducer/TestDump.test index 2e717152057..3d4d21d98e5 100644 --- a/lldb/test/Shell/Reproducer/TestDump.test +++ b/lldb/test/Shell/Reproducer/TestDump.test @@ -4,7 +4,7 @@ # Generate a reproducer. # RUN: mkdir -p %t # RUN: rm -rf %t.repro -# RUN: %clang %S/Inputs/simple.c -g -o %t/reproducer.out +# RUN: %clang_host %S/Inputs/simple.c -g -o %t/reproducer.out # RUN: %lldb -x -b -s %S/Inputs/FileCapture.in -o 'reproducer dump -p files' --capture --capture-path %t.repro %t/reproducer.out # RUN: %lldb -b -o 'reproducer dump -p files -f %t.repro' | FileCheck %s --check-prefix FILES diff --git a/lldb/test/Shell/Reproducer/TestFileRepro.test b/lldb/test/Shell/Reproducer/TestFileRepro.test index 31b76703689..0fc3d528445 100644 --- a/lldb/test/Shell/Reproducer/TestFileRepro.test +++ b/lldb/test/Shell/Reproducer/TestFileRepro.test @@ -7,7 +7,7 @@ # that the string "testing" is not printed. # RUN: rm -rf %t.repro -# RUN: %clang %S/Inputs/simple.c -g -o %t.out +# RUN: %clang_host %S/Inputs/simple.c -g -o %t.out # RUN: %lldb -x -b -s %S/Inputs/FileCapture.in --capture --capture-path %t.repro %t.out | FileCheck %s --check-prefix CHECK --check-prefix CAPTURE # RUN: rm %t.out # RUN: %lldb --replay %t.repro | FileCheck %s --check-prefix CHECK --check-prefix REPLAY diff --git a/lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test b/lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test index 09e566ffb95..04a3e5465bb 100644 --- a/lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test +++ b/lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test @@ -7,7 +7,7 @@ # that the string "testing" is not printed. # RUN: rm -rf %t.repro -# RUN: %clang %S/Inputs/simple.c -g -o %t.out +# RUN: %clang_host %S/Inputs/simple.c -g -o %t.out # RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture --capture-path %t.repro %t.out | FileCheck %s --check-prefix CHECK --check-prefix CAPTURE # RUN: env FOO=BAR %lldb --replay %t.repro | FileCheck %s --check-prefix CHECK --check-prefix REPLAY diff --git a/lldb/test/Shell/Reproducer/TestRelativePath.test b/lldb/test/Shell/Reproducer/TestRelativePath.test index 1c871ee81e8..fa751878455 100644 --- a/lldb/test/Shell/Reproducer/TestRelativePath.test +++ b/lldb/test/Shell/Reproducer/TestRelativePath.test @@ -3,6 +3,6 @@ # RUN: mkdir -p %t # RUN: cd %t # RUN: rm -rf ./foo -# RUN: %clang %S/Inputs/simple.c -g -o %t/reproducer.out +# RUN: %clang_host %S/Inputs/simple.c -g -o %t/reproducer.out # RUN: %lldb -x -b -s %S/Inputs/FileCapture.in -o 'reproducer dump -p files' --capture --capture-path ./foo %t/reproducer.out # RUN: %lldb --replay ./foo diff --git a/lldb/test/Shell/Reproducer/TestReuseDirectory.test b/lldb/test/Shell/Reproducer/TestReuseDirectory.test index 76c74b7ee1d..31b71a0f260 100644 --- a/lldb/test/Shell/Reproducer/TestReuseDirectory.test +++ b/lldb/test/Shell/Reproducer/TestReuseDirectory.test @@ -4,7 +4,7 @@ # reproducer functionality. # RUN: rm -rf %t.repro -# RUN: %clang %S/Inputs/simple.c -g -o %t.out +# RUN: %clang_host %S/Inputs/simple.c -g -o %t.out # RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture --capture-path %t.repro %t.out | FileCheck %S/TestGDBRemoteRepro.test --check-prefix CHECK --check-prefix CAPTURE # RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture --capture-path %t.repro %t.out | FileCheck %S/TestGDBRemoteRepro.test --check-prefix CHECK --check-prefix CAPTURE # RUN: %lldb --replay %t.repro | FileCheck %S/TestGDBRemoteRepro.test --check-prefix CHECK --check-prefix REPLAY diff --git a/lldb/test/Shell/Reproducer/TestWorkingDir.test b/lldb/test/Shell/Reproducer/TestWorkingDir.test index fd41e1d43ad..707916bae56 100644 --- a/lldb/test/Shell/Reproducer/TestWorkingDir.test +++ b/lldb/test/Shell/Reproducer/TestWorkingDir.test @@ -11,7 +11,7 @@ # RUN: mkdir -p %t # RUN: mkdir -p %t/binary # RUN: cd %t -# RUN: %clang %S/Inputs/simple.c -g -o binary/reproducer.out +# RUN: %clang_host %S/Inputs/simple.c -g -o binary/reproducer.out # RUN: %lldb -x -b -s %S/Inputs/WorkingDir.in --capture --capture-path %t.repro binary/reproducer.out # RUN: rm -rf %t/binary |

