[all-commits] [llvm/llvm-project] 9c7392: [lldb/lit] Introduce %clang_host substitutions

Pavel Labath via All-commits all-commits at lists.llvm.org
Thu Oct 31 02:41:52 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9c739252261ea762d1bbbd8234d93c9038711fcd
      https://github.com/llvm/llvm-project/commit/9c739252261ea762d1bbbd8234d93c9038711fcd
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2019-10-31 (Thu, 31 Oct 2019)

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

  Log Message:
  -----------
  [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




More information about the All-commits mailing list