llvm.org GIT mirror llvm / bab7762
[ThinLTO] Disallow multiple prevailing defs https://reviews.llvm.org/D41291 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320825 91177308-0d34-0410-b5e6-96231b3b80d8 Eugene Leviant 2 years ago
4 changed file(s) with 6 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
416416 auto &GlobalRes = GlobalResolutions[Sym.getName()];
417417 GlobalRes.UnnamedAddr &= Sym.isUnnamedAddr();
418418 if (Res.Prevailing) {
419 assert((GlobalRes.IRName.empty() || !Sym.getIRName().empty()) &&
420 "Overriding existing resolution with undefined asm symbol");
419 assert(GlobalRes.IRName.empty() &&
420 "Multiple prevailing defs are not allowed");
421421 GlobalRes.IRName = Sym.getIRName();
422422 }
423423
5151 ; RUN: -r %t2.bc,bar,px
5252 ; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=NONE-PREVAILED2
5353
54
55
56 ; Client marked both as prevailing
57 ; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
58 ; RUN: -r %t1.bc,v,px \
59 ; RUN: -r %t2.bc,v,px \
60 ; RUN: -r %t1.bc,foo,px \
61 ; RUN: -r %t2.bc,bar,px
62 ; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=BOTH-PREVAILED1
63
64 ; Same as before, but reversing the order of the inputs
65 ; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \
66 ; RUN: -r %t1.bc,v,px \
67 ; RUN: -r %t2.bc,v,px \
68 ; RUN: -r %t1.bc,foo,px \
69 ; RUN: -r %t2.bc,bar,px
70 ; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=BOTH-PREVAILED2
71
7254 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7355 target triple = "x86_64-unknown-linux-gnu"
7456
11 ; RUN: opt -module-summary -o %t2 %S/Inputs/dead-strip-fulllto.ll
22
33 ; RUN: llvm-lto2 run %t -r %t,main,px -r %t,live1,p -r %t,live2,p -r %t,dead2,p \
4 ; RUN: %t2 -r %t2,live1,p -r %t2,live2, -r %t2,dead1,p -r %t2,dead2, -r %t2,odr, \
4 ; RUN: %t2 -r %t2,live1, -r %t2,live2, -r %t2,dead1,p -r %t2,dead2, -r %t2,odr, \
55 ; RUN: -save-temps -o %t3
66 ; RUN: llvm-nm %t3.0 | FileCheck --check-prefix=FULL %s
77 ; RUN: llvm-nm %t3.1 | FileCheck --check-prefix=THIN %s
88
99 ; RUN: llvm-lto2 run %t -r %t,main,px -r %t,live1,p -r %t,live2,p -r %t,dead2,p \
10 ; RUN: %t2 -r %t2,live1,p -r %t2,live2, -r %t2,dead1,p -r %t2,dead2, -r %t2,odr, \
10 ; RUN: %t2 -r %t2,live1, -r %t2,live2, -r %t2,dead1,p -r %t2,dead2, -r %t2,odr, \
1111 ; RUN: -save-temps -o %t3 -O0
1212 ; RUN: llvm-nm %t3.0 | FileCheck --check-prefix=FULL %s
1313 ; RUN: llvm-nm %t3.1 | FileCheck --check-prefix=THIN %s
1515 ; RUN: -r %t1.bc,_boo,l \
1616 ; RUN: -r %t2.bc,_baz,pl \
1717 ; RUN: -r %t2.bc,_boo,pl \
18 ; RUN: -r %t2.bc,_dead_func,pl \
18 ; RUN: -r %t2.bc,_dead_func,l \
1919 ; RUN: -r %t2.bc,_another_dead_func,pl
2020 ; RUN: llvm-dis < %t.out.0.3.import.bc | FileCheck %s --check-prefix=LTO2
2121 ; RUN: llvm-dis < %t.out.1.3.import.bc | FileCheck %s --check-prefix=LTO2-CHECK2
8080 ; RUN: -r %t1.bc,_boo,l \
8181 ; RUN: -r %t3.bc,_baz,pl \
8282 ; RUN: -r %t3.bc,_boo,pl \
83 ; RUN: -r %t3.bc,_dead_func,pl \
83 ; RUN: -r %t3.bc,_dead_func,l \
8484 ; RUN: -r %t3.bc,_another_dead_func,pl
8585 ; RUN: llvm-dis < %t4.out.1.3.import.bc | FileCheck %s --check-prefix=CHECK-NOTDEAD
8686 ; RUN: llvm-nm %t4.out.0 | FileCheck %s --check-prefix=CHECK-NM-NOTDEAD