[lld] r310556 - [ELF] - Add a test for --gc-sections --undefined=foo combination.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 10 01:15:33 PDT 2017
Author: grimar
Date: Thu Aug 10 01:15:33 2017
New Revision: 310556
URL: http://llvm.org/viewvc/llvm-project?rev=310556&view=rev
Log:
[ELF] - Add a test for --gc-sections --undefined=foo combination.
GC code contains following logic uncovered by tests:
for (StringRef S : Config->Undefined)
MarkSymbol(Symtab->find(S));
As far I can tell we never had test for that before,
patch fixes it.
Differential revision: https://reviews.llvm.org/D36519
Added:
lld/trunk/test/ELF/gc-sections-undefined.s
Added: lld/trunk/test/ELF/gc-sections-undefined.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-sections-undefined.s?rev=310556&view=auto
==============================================================================
--- lld/trunk/test/ELF/gc-sections-undefined.s (added)
+++ lld/trunk/test/ELF/gc-sections-undefined.s Thu Aug 10 01:15:33 2017
@@ -0,0 +1,10 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
+# RUN: ld.lld %t -o %t1 --gc-sections --undefined=foo
+# RUN: llvm-readobj -t %t1 | FileCheck %s
+
+# CHECK: foo
+
+.section .foo,"ax"
+.global foo
+foo:
More information about the llvm-commits
mailing list