summaryrefslogtreecommitdiffstats
path: root/llvm/test/LTO/Resolution/X86/Inputs/comdat.ll
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-08-11 12:56:40 +0000
committerTeresa Johnson <tejohnson@google.com>2016-08-11 12:56:40 +0000
commitf99573b3ee6009494d431348ec92dcab7b6a218b (patch)
tree57c77754b9215a0e3429c659d9c5eb56b15f351d /llvm/test/LTO/Resolution/X86/Inputs/comdat.ll
parent5c91764af5d5dc27c4e52073c0361d7a452c5a8c (diff)
downloadbcm5719-llvm-f99573b3ee6009494d431348ec92dcab7b6a218b.tar.gz
bcm5719-llvm-f99573b3ee6009494d431348ec92dcab7b6a218b.zip
Resolution-based LTO API.
Summary: This introduces a resolution-based LTO API. The main advantage of this API over existing APIs is that it allows the linker to supply a resolution for each symbol in each object, rather than the combined object as a whole. This will become increasingly important for use cases such as ThinLTO which require us to process symbol resolutions in a more complicated way than just adjusting linkage. Patch by Peter Collingbourne. Reviewers: rafael, tejohnson, mehdi_amini Subscribers: lhames, tejohnson, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D20268 Address review comments llvm-svn: 278330
Diffstat (limited to 'llvm/test/LTO/Resolution/X86/Inputs/comdat.ll')
-rw-r--r--llvm/test/LTO/Resolution/X86/Inputs/comdat.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/LTO/Resolution/X86/Inputs/comdat.ll b/llvm/test/LTO/Resolution/X86/Inputs/comdat.ll
new file mode 100644
index 00000000000..ca4bbb4bf81
--- /dev/null
+++ b/llvm/test/LTO/Resolution/X86/Inputs/comdat.ll
@@ -0,0 +1,28 @@
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+$c2 = comdat any
+$c1 = comdat any
+
+; This is only present in this file. The linker will keep $c1 from the first
+; file and this will be undefined.
+@will_be_undefined = global i32 1, comdat($c1)
+
+@v1 = weak_odr global i32 41, comdat($c2)
+define weak_odr protected i32 @f1(i8* %this) comdat($c2) {
+bb20:
+ store i8* %this, i8** null
+ br label %bb21
+bb21:
+ ret i32 41
+}
+
+@r21 = global i32* @v1
+@r22 = global i32(i8*)* @f1
+
+@a21 = alias i32, i32* @v1
+@a22 = alias i16, bitcast (i32* @v1 to i16*)
+
+@a23 = alias i32(i8*), i32(i8*)* @f1
+@a24 = alias i16, bitcast (i32(i8*)* @f1 to i16*)
+@a25 = alias i16, i16* @a24
OpenPOWER on IntegriCloud