summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2017-07-07 16:40:19 +0000
committerDavide Italiano <davide@freebsd.org>2017-07-07 16:40:19 +0000
commit6687318babb9477e56e04df73bf8a4abb68b263a (patch)
tree8655326f646a146fec90e4ba150990062451dec2
parentcb07d67a5c3970c0bf7f3ceb59526af07fef7b72 (diff)
downloadbcm5719-llvm-6687318babb9477e56e04df73bf8a4abb68b263a.tar.gz
bcm5719-llvm-6687318babb9477e56e04df73bf8a4abb68b263a.zip
[LTO] Add a test for ThinLTO + --defsym.
We also get this right since r307303. llvm-svn: 307412
-rw-r--r--lld/test/ELF/lto/defsym.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/lld/test/ELF/lto/defsym.ll b/lld/test/ELF/lto/defsym.ll
index 4c2fe45b3c5..2ce8570f9b6 100644
--- a/lld/test/ELF/lto/defsym.ll
+++ b/lld/test/ELF/lto/defsym.ll
@@ -1,9 +1,16 @@
; REQUIRES: x86
+; LTO
; RUN: llvm-as %s -o %t.o
; RUN: llvm-as %S/Inputs/defsym-bar.ll -o %t1.o
; RUN: ld.lld %t.o %t1.o -shared -o %t.so -defsym=bar2=bar3
; RUN: llvm-objdump -d %t.so | FileCheck %s
+; ThinLTO
+; RUN: opt -module-summary %s -o %t.o
+; RUN: opt -module-summary %S/Inputs/defsym-bar.ll -o %t1.o
+; RUN: ld.lld %t.o %t1.o -shared -o %t.so -defsym=bar2=bar3
+; RUN: llvm-objdump -d %t.so | FileCheck %s --check-prefix=THIN
+
; Call to bar2() should not be inlined and should be routed to bar3()
; Symbol bar3 should not be eliminated
@@ -13,6 +20,13 @@
; CHECK-NEXT: callq{{.*}}<bar3>
; CHECK-NEXT: callq
+; THIN: foo
+; THIN-NEXT: pushq %rax
+; THIN-NEXT: callq
+; THIN-NEXT: callq{{.*}}<bar3>
+; THIN-NEXT: popq %rax
+; THIN-NEXT: jmp
+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
OpenPOWER on IntegriCloud