summaryrefslogtreecommitdiffstats
path: root/llvm/test/LTO/Resolution/X86/mixed_lto.ll
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-09-16 13:54:19 +0000
committerTeresa Johnson <tejohnson@google.com>2016-09-16 13:54:19 +0000
commit8dd61aee30541523012e713f15152744a7222e90 (patch)
tree6d84e3000f904069ca1cd6598ba3168be2206795 /llvm/test/LTO/Resolution/X86/mixed_lto.ll
parentcf060794cd4da110c96530f437f2f2586347b1f3 (diff)
downloadbcm5719-llvm-8dd61aee30541523012e713f15152744a7222e90.tar.gz
bcm5719-llvm-8dd61aee30541523012e713f15152744a7222e90.zip
[LTO] Fix handling of mixed (regular and thin) mode LTO
Summary: In runThinLTO we start the task numbering for ThinLTO backend tasks depending on whether there was also a regular LTO object (CombinedModule). However, the CombinedModule is moved at the end of runRegularLTO, so we need to save this information and pass it into runThinLTO. Otherwise the AddOutput callback to the client will use the same task number for both the regular LTO object and the first ThinLTO object, which in gold-plugin caused only one to be end up in the output filename array and therefore passed back to gold for the final native link. Reviewers: pcc, mehdi_amini Subscribers: mehdi_amini, kromanova Differential Revision: https://reviews.llvm.org/D24643 llvm-svn: 281725
Diffstat (limited to 'llvm/test/LTO/Resolution/X86/mixed_lto.ll')
-rw-r--r--llvm/test/LTO/Resolution/X86/mixed_lto.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/LTO/Resolution/X86/mixed_lto.ll b/llvm/test/LTO/Resolution/X86/mixed_lto.ll
new file mode 100644
index 00000000000..ea56a2a2c62
--- /dev/null
+++ b/llvm/test/LTO/Resolution/X86/mixed_lto.ll
@@ -0,0 +1,19 @@
+; Test mixed-mode LTO (mix of regular and thin LTO objects)
+; RUN: opt %s -o %t1.o
+; RUN: opt -module-summary %p/Inputs/mixed_lto.ll -o %t2.o
+
+; RUN: llvm-lto2 -o %t3.o %t2.o %t1.o -r %t2.o,main,px -r %t2.o,g, -r %t1.o,g,px
+
+; Task 0 is the regular LTO file (this file)
+; RUN: nm %t3.o.0 | FileCheck %s --check-prefix=NM0
+; NM0: T g
+
+; Task 1 is the (first) ThinLTO file (Inputs/mixed_lto.ll)
+; RUN: nm %t3.o.1 | FileCheck %s --check-prefix=NM1
+; NM1-DAG: T main
+; NM1-DAG: U g
+
+target triple = "x86_64-unknown-linux-gnu"
+define i32 @g() {
+ ret i32 0
+}
OpenPOWER on IntegriCloud