[lld] r339114 - [LLD][ELF] - Add a test case for code in Archive::fetch(). NFCI.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 7 01:41:38 PDT 2018


Author: grimar
Date: Tue Aug  7 01:41:37 2018
New Revision: 339114

URL: http://llvm.org/viewvc/llvm-project?rev=339114&view=rev
Log:
[LLD][ELF] - Add a test case for code in Archive::fetch(). NFCI.

This covers the following piece with a test.
https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L830

Thanks to Peter Collingbourne for providing the reproducer sample!

Added:
    lld/trunk/test/ELF/archive-fetch.s

Added: lld/trunk/test/ELF/archive-fetch.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/archive-fetch.s?rev=339114&view=auto
==============================================================================
--- lld/trunk/test/ELF/archive-fetch.s (added)
+++ lld/trunk/test/ELF/archive-fetch.s Tue Aug  7 01:41:37 2018
@@ -0,0 +1,15 @@
+# REQUIRES: x86
+
+# We have a code in LLD that prevents fetching the same object from archive file twice.
+# This test triggers that code, without it we would fail to link output.
+
+# RUN: echo '.globl foo, bar; foo:' | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %tfoo.o
+# RUN: echo '.globl foo, bar; bar:' | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %tbar.o
+# RUN: rm -f %t.a
+# RUN: llvm-ar rcs %t.a %tfoo.o %tbar.o
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+# RUN: ld.lld %t.a %t.o -o /dev/null
+
+_start:
+callq foo




More information about the llvm-commits mailing list