forked from OSchip/llvm-project
[NVPTX] Emit .weak linkage for link_once, weak, available_externally, and common linkage
llvm-svn: 211941
This commit is contained in:
parent
73cb5de546
commit
d73767a80a
|
@ -1367,6 +1367,10 @@ void NVPTXAsmPrinter::printModuleLevelGV(const GlobalVariable *GVar,
|
|||
O << ".visible ";
|
||||
else
|
||||
O << ".extern ";
|
||||
} else if (GVar->hasLinkOnceLinkage() || GVar->hasWeakLinkage() ||
|
||||
GVar->hasAvailableExternallyLinkage() ||
|
||||
GVar->hasCommonLinkage()) {
|
||||
O << ".weak ";
|
||||
}
|
||||
|
||||
if (llvm::isTexture(*GVar)) {
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
|
||||
|
||||
; CHECK: .weak .global .align 4 .u32 g
|
||||
@g = common addrspace(1) global i32 zeroinitializer
|
||||
|
||||
define i32 @func0() {
|
||||
%val = load i32 addrspace(1)* @g
|
||||
ret i32 %val
|
||||
}
|
Loading…
Reference in New Issue