summaryrefslogtreecommitdiff
path: root/test/LTO
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-05-25 23:40:11 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-05-25 23:40:11 +0000
commitc58f672ed11708770252f6e7fe7cc2289218c069 (patch)
treedfc47858c596599dce12c7bfcb377da543235901 /test/LTO
parentdcf3dde852d120809621ce4ca33f4225f53c78dc (diff)
LTO: Do summary-based prevailing symbol resolution at --lto-O0.
Prevailing symbol resolution is necessary for correctness. Without this we can end up dropping a referenced linkonce symbol from the link. Differential Revision: https://reviews.llvm.org/D33570 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/LTO')
-rw-r--r--test/LTO/Resolution/X86/linkonce.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/LTO/Resolution/X86/linkonce.ll b/test/LTO/Resolution/X86/linkonce.ll
new file mode 100644
index 00000000000..33d2df740a4
--- /dev/null
+++ b/test/LTO/Resolution/X86/linkonce.ll
@@ -0,0 +1,11 @@
+; RUN: opt -module-summary -o %t %s
+; RUN: llvm-lto2 run %t -O0 -r %t,foo,px -o %t2
+; RUN: llvm-nm %t2.0 | FileCheck %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+; CHECK: W foo
+define linkonce_odr void @foo() {
+ ret void
+}