mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 02:52:53 +02:00
Correctly merge available_externally and regular definitions when they have
different visibilities. llvm-svn: 124650
This commit is contained in:
parent
3689d1302d
commit
e60f9519d8
@ -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