[Lldb-commits] [PATCH] D69619: [lldb/lit] Introduce %clang_host substitutions

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 30 08:53:06 PDT 2019


labath created this revision.
labath added reviewers: JDevlieghere, aprantl, mstorsjo.
Herald added subscribers: jfb, MaskRay, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLDB.

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 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69619

Files:
  lldb/test/Shell/Commands/command-script-import.test
  lldb/test/Shell/Driver/TestSingleQuote.test
  lldb/test/Shell/Driver/TestTarget.test
  lldb/test/Shell/ExecControl/StopHook/stop-hook-threads.test
  lldb/test/Shell/ExecControl/StopHook/stop-hook.test
  lldb/test/Shell/Expr/TestIRMemoryMap.test
  lldb/test/Shell/Expr/TestIRMemoryMapWindows.test
  lldb/test/Shell/Heap/heap-cstr.test
  lldb/test/Shell/Host/TestCustomShell.test
  lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test
  lldb/test/Shell/Process/TestEnvironment.test
  lldb/test/Shell/Register/aarch64-fp-read.test
  lldb/test/Shell/Register/aarch64-gp-read.test
  lldb/test/Shell/Register/arm-fp-read.test
  lldb/test/Shell/Register/arm-gp-read.test
  lldb/test/Shell/Register/x86-64-gp-read.test
  lldb/test/Shell/Register/x86-64-gp-write.test
  lldb/test/Shell/Register/x86-64-read.test
  lldb/test/Shell/Register/x86-64-write.test
  lldb/test/Shell/Register/x86-64-xmm16-read.test
  lldb/test/Shell/Register/x86-64-xmm16-write.test
  lldb/test/Shell/Register/x86-64-ymm-read.test
  lldb/test/Shell/Register/x86-64-ymm-write.test
  lldb/test/Shell/Register/x86-64-ymm16-read.test
  lldb/test/Shell/Register/x86-64-ymm16-write.test
  lldb/test/Shell/Register/x86-64-zmm-read.test
  lldb/test/Shell/Register/x86-64-zmm-write.test
  lldb/test/Shell/Register/x86-gp-read.test
  lldb/test/Shell/Register/x86-gp-write.test
  lldb/test/Shell/Register/x86-mm-xmm-read.test
  lldb/test/Shell/Register/x86-mm-xmm-write.test
  lldb/test/Shell/Register/x86-ymm-read.test
  lldb/test/Shell/Register/x86-ymm-write.test
  lldb/test/Shell/Register/x86-zmm-read.test
  lldb/test/Shell/Register/x86-zmm-write.test
  lldb/test/Shell/Reproducer/Functionalities/TestDataFormatter.test
  lldb/test/Shell/Reproducer/Functionalities/TestImageList.test
  lldb/test/Shell/Reproducer/Functionalities/TestStepping.test
  lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test
  lldb/test/Shell/Reproducer/TestDump.test
  lldb/test/Shell/Reproducer/TestFileRepro.test
  lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test
  lldb/test/Shell/Reproducer/TestRelativePath.test
  lldb/test/Shell/Reproducer/TestReuseDirectory.test
  lldb/test/Shell/Reproducer/TestWorkingDir.test
  lldb/test/Shell/Settings/TestFrameFormatColor.test
  lldb/test/Shell/Settings/TestFrameFormatNoColor.test
  lldb/test/Shell/SymbolFile/DWARF/anon_class_w_and_wo_export_symbols.ll
  lldb/test/Shell/SymbolFile/DWARF/clang-ast-from-dwarf-unamed-and-anon-structs.cpp
  lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test
  lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
  lldb/test/Shell/SymbolFile/PDB/function-level-linking.test
  lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test
  lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test
  lldb/test/Shell/Unwind/eh-frame-small-fde.test
  lldb/test/Shell/Unwind/prefer-debug-over-eh-frame.test
  lldb/test/Shell/Unwind/trap_frame_sym_ctx.test
  lldb/test/Shell/Unwind/unwind-plan-dwarf-dump.test
  lldb/test/Shell/Watchpoint/SetErrorCases.test
  lldb/test/Shell/helper/toolchain.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69619.227117.patch
Type: text/x-patch
Size: 35915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191030/5a48324a/attachment-0001.bin>


More information about the lldb-commits mailing list