[lld] r307412 - [LTO] Add a test for ThinLTO + --defsym.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 7 09:40:19 PDT 2017
Author: davide
Date: Fri Jul 7 09:40:19 2017
New Revision: 307412
URL: http://llvm.org/viewvc/llvm-project?rev=307412&view=rev
Log:
[LTO] Add a test for ThinLTO + --defsym.
We also get this right since r307303.
Modified:
lld/trunk/test/ELF/lto/defsym.ll
Modified: lld/trunk/test/ELF/lto/defsym.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/defsym.ll?rev=307412&r1=307411&r2=307412&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/defsym.ll (original)
+++ lld/trunk/test/ELF/lto/defsym.ll Fri Jul 7 09:40:19 2017
@@ -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"
More information about the llvm-commits
mailing list