aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Leviant <eleviant@accesssoftek.com>2017-12-15 16:27:33 +0000
committerEugene Leviant <eleviant@accesssoftek.com>2017-12-15 16:27:33 +0000
commitbab7762fc59cd5a1171897fdf2524dc1dcf5841c (patch)
tree160fdd4ef5ec166902617766e5981f4a374a69d1
parent021be3a67e3187d58b94a79843366957037c92b8 (diff)
[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
-rw-r--r--lib/LTO/LTO.cpp4
-rw-r--r--test/LTO/Resolution/X86/common2.ll18
-rw-r--r--test/LTO/Resolution/X86/dead-strip-fulllto.ll4
-rw-r--r--test/ThinLTO/X86/deadstrip.ll4
4 files changed, 6 insertions, 24 deletions
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp
index d6b50f551d9..69a696793a6 100644
--- a/lib/LTO/LTO.cpp
+++ b/lib/LTO/LTO.cpp
@@ -417,8 +417,8 @@ void LTO::addModuleToGlobalRes(ArrayRef<InputFile::Symbol> Syms,
auto &GlobalRes = GlobalResolutions[Sym.getName()];
GlobalRes.UnnamedAddr &= Sym.isUnnamedAddr();
if (Res.Prevailing) {
- assert((GlobalRes.IRName.empty() || !Sym.getIRName().empty()) &&
- "Overriding existing resolution with undefined asm symbol");
+ assert(GlobalRes.IRName.empty() &&
+ "Multiple prevailing defs are not allowed");
GlobalRes.IRName = Sym.getIRName();
}
diff --git a/test/LTO/Resolution/X86/common2.ll b/test/LTO/Resolution/X86/common2.ll
index 3cb0a992d9a..de702d05700 100644
--- a/test/LTO/Resolution/X86/common2.ll
+++ b/test/LTO/Resolution/X86/common2.ll
@@ -52,24 +52,6 @@
; RUN: -r %t2.bc,bar,px
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=NONE-PREVAILED2
-
-
-; Client marked both as prevailing
-; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
-; RUN: -r %t1.bc,v,px \
-; RUN: -r %t2.bc,v,px \
-; RUN: -r %t1.bc,foo,px \
-; RUN: -r %t2.bc,bar,px
-; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=BOTH-PREVAILED1
-
-; Same as before, but reversing the order of the inputs
-; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \
-; RUN: -r %t1.bc,v,px \
-; RUN: -r %t2.bc,v,px \
-; RUN: -r %t1.bc,foo,px \
-; RUN: -r %t2.bc,bar,px
-; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=BOTH-PREVAILED2
-
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/test/LTO/Resolution/X86/dead-strip-fulllto.ll b/test/LTO/Resolution/X86/dead-strip-fulllto.ll
index 02b0e38fb9b..773b4385378 100644
--- a/test/LTO/Resolution/X86/dead-strip-fulllto.ll
+++ b/test/LTO/Resolution/X86/dead-strip-fulllto.ll
@@ -2,13 +2,13 @@
; RUN: opt -module-summary -o %t2 %S/Inputs/dead-strip-fulllto.ll
; RUN: llvm-lto2 run %t -r %t,main,px -r %t,live1,p -r %t,live2,p -r %t,dead2,p \
-; RUN: %t2 -r %t2,live1,p -r %t2,live2, -r %t2,dead1,p -r %t2,dead2, -r %t2,odr, \
+; RUN: %t2 -r %t2,live1, -r %t2,live2, -r %t2,dead1,p -r %t2,dead2, -r %t2,odr, \
; RUN: -save-temps -o %t3
; RUN: llvm-nm %t3.0 | FileCheck --check-prefix=FULL %s
; RUN: llvm-nm %t3.1 | FileCheck --check-prefix=THIN %s
; RUN: llvm-lto2 run %t -r %t,main,px -r %t,live1,p -r %t,live2,p -r %t,dead2,p \
-; RUN: %t2 -r %t2,live1,p -r %t2,live2, -r %t2,dead1,p -r %t2,dead2, -r %t2,odr, \
+; RUN: %t2 -r %t2,live1, -r %t2,live2, -r %t2,dead1,p -r %t2,dead2, -r %t2,odr, \
; RUN: -save-temps -o %t3 -O0
; RUN: llvm-nm %t3.0 | FileCheck --check-prefix=FULL %s
; RUN: llvm-nm %t3.1 | FileCheck --check-prefix=THIN %s
diff --git a/test/ThinLTO/X86/deadstrip.ll b/test/ThinLTO/X86/deadstrip.ll
index 90de3bb9a32..36115e9811d 100644
--- a/test/ThinLTO/X86/deadstrip.ll
+++ b/test/ThinLTO/X86/deadstrip.ll
@@ -16,7 +16,7 @@
; RUN: -r %t1.bc,_boo,l \
; RUN: -r %t2.bc,_baz,pl \
; RUN: -r %t2.bc,_boo,pl \
-; RUN: -r %t2.bc,_dead_func,pl \
+; RUN: -r %t2.bc,_dead_func,l \
; RUN: -r %t2.bc,_another_dead_func,pl
; RUN: llvm-dis < %t.out.0.3.import.bc | FileCheck %s --check-prefix=LTO2
; RUN: llvm-dis < %t.out.1.3.import.bc | FileCheck %s --check-prefix=LTO2-CHECK2
@@ -81,7 +81,7 @@
; RUN: -r %t1.bc,_boo,l \
; RUN: -r %t3.bc,_baz,pl \
; RUN: -r %t3.bc,_boo,pl \
-; RUN: -r %t3.bc,_dead_func,pl \
+; RUN: -r %t3.bc,_dead_func,l \
; RUN: -r %t3.bc,_another_dead_func,pl
; RUN: llvm-dis < %t4.out.1.3.import.bc | FileCheck %s --check-prefix=CHECK-NOTDEAD
; RUN: llvm-nm %t4.out.0 | FileCheck %s --check-prefix=CHECK-NM-NOTDEAD