[PATCH] D42299: [ELF] Add test for interaction of --gc-sections and undefined references

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 03:00:45 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL323099: Add test for interaction of --gc-sections and undefined references (authored by jhenderson, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D42299?vs=130613&id=130859#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D42299

Files:
  lld/trunk/test/ELF/gc-sections-no-undef-error.s


Index: lld/trunk/test/ELF/gc-sections-no-undef-error.s
===================================================================
--- lld/trunk/test/ELF/gc-sections-no-undef-error.s
+++ lld/trunk/test/ELF/gc-sections-no-undef-error.s
@@ -0,0 +1,19 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+
+# Sanity check that the link will fail with the undefined error without
+# gc-sections.
+# RUN: not ld.lld %t.o -o %t 2>&1 | FileCheck %s
+# CHECK: error: undefined symbol: undefined
+
+# RUN: ld.lld %t.o --gc-sections -o %t
+
+.section .text.unused,"ax", at progbits
+unused:
+  callq undefined
+
+.text
+.global _start
+_start:
+  nop


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42299.130859.patch
Type: text/x-patch
Size: 665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180122/66cddc6e/attachment.bin>


More information about the llvm-commits mailing list