diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:17:04 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:17:04 +0000 |
| commit | b915e9e0fc85ba6f398b3fab0db6a81a8913af94 (patch) | |
| tree | 98b8f811c7aff2547cab8642daf372d6c59502fb /test/tools/gold/X86/thinlto_weak_resolution.ll | |
| parent | 6421cca32f69ac849537a3cff78c352195e99f1b (diff) | |
Notes
Diffstat (limited to 'test/tools/gold/X86/thinlto_weak_resolution.ll')
| -rw-r--r-- | test/tools/gold/X86/thinlto_weak_resolution.ll | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/test/tools/gold/X86/thinlto_weak_resolution.ll b/test/tools/gold/X86/thinlto_weak_resolution.ll index a6c6f37895b1..8215c42f10cd 100644 --- a/test/tools/gold/X86/thinlto_weak_resolution.ll +++ b/test/tools/gold/X86/thinlto_weak_resolution.ll @@ -13,13 +13,20 @@ ; RUN: llvm-nm %t3.o | FileCheck %s ; CHECK: weakfunc -; All of the preempted functions should have been eliminated (the plugin will -; not link them in). -; RUN: llvm-dis %t2.o.opt.bc -o - | FileCheck --check-prefix=OPT2 %s +; Most of the preempted functions should have been eliminated (the plugin will +; set linkage of odr functions to available_externally and linkonce functions +; are removed by globaldce). FIXME: Need to introduce combined index linkage +; that means "drop this function" so we can avoid importing linkonce functions +; and drop weak functions. +; RUN: llvm-dis %t2.o.4.opt.bc -o - | FileCheck --check-prefix=OPT2 %s +; OPT2-NOT: @ +; OPT2: @weakfunc ; OPT2-NOT: @ -; RUN: llvm-dis %t.o.opt.bc -o - | FileCheck --check-prefix=OPT %s +; RUN: llvm-dis %t.o.3.import.bc -o - | FileCheck --check-prefix=IMPORT %s +; RUN llvm-dis %t2.o.3.import.bc -o - | FileCheck --check-prefix=IMPORT2 %s +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" @@ -37,50 +44,64 @@ entry: ret i32 0 } -; Alias are resolved -; OPT: @linkonceodralias = weak_odr alias void (), void ()* @linkonceodrfuncwithalias +; Alias are resolved to weak_odr in prevailing module, but left as linkonce_odr +; in non-prevailing module (illegal to have an available_externally alias). +; IMPORT: @linkonceodralias = weak_odr alias void (), void ()* @linkonceodrfuncwithalias +; IMPORT2: @linkonceodralias = linkonce_odr alias void (), void ()* @linkonceodrfuncwithalias @linkonceodralias = linkonce_odr alias void (), void ()* @linkonceodrfuncwithalias -; Alias are resolved -; OPT: @linkoncealias = weak alias void (), void ()* @linkoncefuncwithalias +; Alias are resolved in prevailing module, but not optimized in +; non-prevailing module (illegal to have an available_externally alias). +; IMPORT: @linkoncealias = weak alias void (), void ()* @linkoncefuncwithalias +; IMPORT2: @linkoncealias = linkonce alias void (), void ()* @linkoncefuncwithalias @linkoncealias = linkonce alias void (), void ()* @linkoncefuncwithalias -; Function with an alias are not optimized -; OPT: define linkonce_odr void @linkonceodrfuncwithalias() +; Function with an alias are resolved in prevailing module, but +; not optimized in non-prevailing module (illegal to have an +; available_externally aliasee). +; IMPORT: define weak_odr void @linkonceodrfuncwithalias() +; IMPORT2: define linkonce_odr void @linkonceodrfuncwithalias() define linkonce_odr void @linkonceodrfuncwithalias() #0 { entry: ret void } -; Function with an alias are not optimized -; OPT: define linkonce void @linkoncefuncwithalias() +; Function with an alias are resolved to weak in prevailing module, but +; not optimized in non-prevailing module (illegal to have an +; available_externally aliasee). +; IMPORT: define weak void @linkoncefuncwithalias() +; IMPORT2: define linkonce void @linkoncefuncwithalias() define linkonce void @linkoncefuncwithalias() #0 { entry: ret void } -; OPT: define weak_odr void @linkonceodrfunc() +; IMPORT: define weak_odr void @linkonceodrfunc() +; IMPORT2: define available_externally void @linkonceodrfunc() define linkonce_odr void @linkonceodrfunc() #0 { entry: ret void } -; OPT: define weak void @linkoncefunc() +; IMPORT: define weak void @linkoncefunc() +; IMPORT2: define linkonce void @linkoncefunc() define linkonce void @linkoncefunc() #0 { entry: ret void } -; OPT: define weak_odr void @weakodrfunc() +; IMPORT: define weak_odr void @weakodrfunc() +; IMPORT2: define available_externally void @weakodrfunc() define weak_odr void @weakodrfunc() #0 { entry: ret void } -; OPT: define weak void @weakfunc() +; IMPORT: define weak void @weakfunc() +; IMPORT2: define weak void @weakfunc() define weak void @weakfunc() #0 { entry: ret void } -; OPT: weak_odr void @linkonceodrfuncInSingleModule() +; IMPORT: weak_odr void @linkonceodrfuncInSingleModule() define linkonce_odr void @linkonceodrfuncInSingleModule() #0 { entry: ret void |
