diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-08-11 12:56:40 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-08-11 12:56:40 +0000 |
commit | f99573b3ee6009494d431348ec92dcab7b6a218b (patch) | |
tree | 57c77754b9215a0e3429c659d9c5eb56b15f351d /llvm/test/LTO/Resolution/X86/alias.ll | |
parent | 5c91764af5d5dc27c4e52073c0361d7a452c5a8c (diff) | |
download | bcm5719-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/alias.ll')
-rw-r--r-- | llvm/test/LTO/Resolution/X86/alias.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/LTO/Resolution/X86/alias.ll b/llvm/test/LTO/Resolution/X86/alias.ll new file mode 100644 index 00000000000..bd3fcb381b3 --- /dev/null +++ b/llvm/test/LTO/Resolution/X86/alias.ll @@ -0,0 +1,22 @@ +; RUN: llvm-as %s -o %t1.o +; RUN: llvm-as %p/Inputs/alias-1.ll -o %t2.o +; RUN: llvm-lto2 -o %t3.o %t2.o %t1.o -r %t2.o,a,px -r %t1.o,a, -r %t1.o,b,px -save-temps +; RUN: llvm-dis < %t3.o.0.preopt.bc -o - | FileCheck %s +; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt + +; CHECK-NOT: alias +; CHECK: @a = global i32 42 +; CHECK-NEXT: @b = global i32 1 +; CHECK-NOT: alias + +; RES: 2.o{{$}} +; RES: {{^}}-r={{.*}}2.o,a,px{{$}} +; RES: 1.o{{$}} +; RES: {{^}}-r={{.*}}1.o,b,px{{$}} +; RES: {{^}}-r={{.*}}1.o,a,{{$}} + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@a = weak alias i32, i32* @b +@b = global i32 1 |