mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
[NVPTX] Emit .weak linkage for link_once, weak, available_externally, and common linkage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211941 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ab7c0aa662
commit
2a8dc35cca
@ -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)) {
|
||||
|
9
test/CodeGen/NVPTX/weak-global.ll
Normal file
9
test/CodeGen/NVPTX/weak-global.ll
Normal file
@ -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
Block a user