From 889a161b4fd80b54d5c0914ce4edb8b1fcece6f5 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Thu, 5 Jul 2018 12:23:37 +0000 Subject: [PATCH] [ELF] - Test LLD creates empty .imports file. This covers the following code line with a test: https://github.com/llvm-mirror/lld/blob/master/ELF/LTO.cpp#L213 After that, coverage of LTO.cpp is 100%. llvm-svn: 336342 --- lld/test/ELF/lto/thinlto-index-only.ll | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lld/test/ELF/lto/thinlto-index-only.ll b/lld/test/ELF/lto/thinlto-index-only.ll index 1ca0af1e8b05..6263799ee2fd 100644 --- a/lld/test/ELF/lto/thinlto-index-only.ll +++ b/lld/test/ELF/lto/thinlto-index-only.ll @@ -30,9 +30,13 @@ ; 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 +; Test LLD generates empty imports file either because of thinlto-emit-imports-files option. +; RUN: rm -f %t1.o.thinlto.bc +; RUN: rm -f %t1.o.imports +; RUN: ld.lld --plugin-opt=thinlto-index-only -shared %t2.o --start-lib %t1.o --end-lib \ +; RUN: --plugin-opt=thinlto-emit-imports-files -o %t3 ; RUN: ls %t1.o.thinlto.bc +; RUN: ls %t1.o.imports ; Ensure lld generates an error if unable to write an empty index file ; for lazy object file that is not added to link.