[all-commits] [llvm/llvm-project] 556242: [LLD][COFF] Avoid overwriting inputs in tests

Alexandre Ganea via All-commits all-commits at lists.llvm.org
Thu Sep 24 12:09:19 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 55624237be725a6feef84db7f46147335e68ebab
      https://github.com/llvm/llvm-project/commit/55624237be725a6feef84db7f46147335e68ebab
  Author: Alexandre Ganea <alexandre.ganea at ubisoft.com>
  Date:   2020-09-24 (Thu, 24 Sep 2020)

  Changed paths:
    M lld/test/COFF/dll.test
    M lld/test/COFF/guardcf-lto.ll

  Log Message:
  -----------
  [LLD][COFF] Avoid overwriting inputs in tests

Before this patch, these two tests were emitting both a .DLL and .LIB. The output .LIB file name also happens to be an input .LIB file name. This prevented the test from executing a second time when LLD is re-entrant (LLD_IN_TEST=2).

This is a support patch for https://reviews.llvm.org/D70378.


  Commit: f2efb5742cc9f74ad73987760651e3d23894a416
      https://github.com/llvm/llvm-project/commit/f2efb5742cc9f74ad73987760651e3d23894a416
  Author: Alexandre Ganea <alexandre.ganea at ubisoft.com>
  Date:   2020-09-24 (Thu, 24 Sep 2020)

  Changed paths:
    M lld/COFF/Driver.cpp
    M lld/COFF/Writer.cpp
    M lld/COFF/Writer.h
    M lld/Common/ErrorHandler.cpp
    M lld/ELF/Driver.cpp
    M lld/MachO/Driver.cpp
    M lld/include/lld/Common/Driver.h
    M lld/include/lld/Common/ErrorHandler.h
    M lld/lib/Driver/DarwinLdDriver.cpp
    A lld/test/COFF/lit.local.cfg
    M lld/tools/lld/lld.cpp
    M lld/wasm/Driver.cpp

  Log Message:
  -----------
  [LLD][COFF] Cover usage of LLD-as-a-library in tests

In lit tests, we run each LLD invocation twice (LLD_IN_TEST=2), without shutting down the process in-between. This ensures a full cleanup is properly done between runs.
Only active for the COFF driver for now. Other drivers still use LLD_IN_TEST=1 which executes just one iteration with full cleanup, like before.
When the environment variable LLD_IN_TEST is unset, a shortcut is taken, only one iteration is executed, no cleanup for faster exit, like before.
A public API, lld::safeLldMain(), is also available when using LLD as a library.

Differential Revision: https://reviews.llvm.org/D70378


Compare: https://github.com/llvm/llvm-project/compare/d34c8c70aae2...f2efb5742cc9


More information about the All-commits mailing list