[lld] r336270 - [ELF] - LTO: add test for createEmptyIndex.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 4 06:36:45 PDT 2018


Author: grimar
Date: Wed Jul  4 06:36:45 2018
New Revision: 336270

URL: http://llvm.org/viewvc/llvm-project?rev=336270&view=rev
Log:
[ELF] - LTO: add test for createEmptyIndex.

We have a following comment for createEmptyIndex caller code:

// If LazyObjFile has not been added to link, emit empty index files.
// This is needed because this is what GNU gold plugin does and we have a
// distributed build system that depends on that behavior.
  
Though createEmptyIndex() itself
(https://github.com/llvm-mirror/lld/blob/master/ELF/LTO.cpp#L202)
is never called in our test cases. 

Patch adds a test.

Modified:
    lld/trunk/test/ELF/lto/thinlto-index-only.ll

Modified: lld/trunk/test/ELF/lto/thinlto-index-only.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/thinlto-index-only.ll?rev=336270&r1=336269&r2=336270&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/thinlto-index-only.ll (original)
+++ lld/trunk/test/ELF/lto/thinlto-index-only.ll Wed Jul  4 06:36:45 2018
@@ -29,6 +29,11 @@
 ; RUN: ls %t2.o.thinlto.bc
 ; RUN: not test -e %t4
 
+; Test that LLD generates an empty index even for lazy object file that is not added to link.
+; RUN: rm -f %t1.o.thinlto.bc %t3
+; RUN: ld.lld --plugin-opt=thinlto-index-only -shared %t2.o --start-lib %t1.o --end-lib -o %t3
+; RUN: ls %t1.o.thinlto.bc
+
 ; NM: T f
 
 ; The backend index for this module contains summaries from itself and




More information about the llvm-commits mailing list