mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-24 20:30:06 +00:00
Correctly merge available_externally and regular definitions when they have
different visibilities. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124650 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e087afa128
commit
4e93885bab
@ -434,8 +434,10 @@ static bool GetLinkageResult(GlobalValue *Dest, const GlobalValue *Src,
|
||||
}
|
||||
|
||||
// Check visibility
|
||||
if (Dest && Src->getVisibility() != Dest->getVisibility())
|
||||
if (!Src->isDeclaration() && !Dest->isDeclaration())
|
||||
if (Dest && Src->getVisibility() != Dest->getVisibility() &&
|
||||
!Src->isDeclaration() && !Dest->isDeclaration() &&
|
||||
!Src->hasAvailableExternallyLinkage() &&
|
||||
!Dest->hasAvailableExternallyLinkage())
|
||||
return Error(Err, "Linking globals named '" + Src->getName() +
|
||||
"': symbols have different visibilities!");
|
||||
return false;
|
||||
|
5
test/Linker/available_externally_a.ll
Normal file
5
test/Linker/available_externally_a.ll
Normal file
@ -0,0 +1,5 @@
|
||||
; RUN: llvm-link %s %p/available_externally_b.ll -S -o - | FileCheck %s
|
||||
|
||||
@foo = available_externally unnamed_addr constant i32 0
|
||||
|
||||
; CHECK: @foo = hidden unnamed_addr constant i32 0
|
4
test/Linker/available_externally_b.ll
Normal file
4
test/Linker/available_externally_b.ll
Normal file
@ -0,0 +1,4 @@
|
||||
; This file is for use with available_externally_a.ll
|
||||
; RUN: true
|
||||
|
||||
@foo = hidden unnamed_addr constant i32 0
|
Loading…
Reference in New Issue
Block a user