llvm.org GIT mirror llvm / e39a7a6
Also copy private linkage globals when needed. This was an omission when handling COFF style comdats with local keys. Should fix the sanitizer-windows bot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254543 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 4 years ago
3 changed file(s) with 16 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
14251425 std::tie(SK, LinkFromSrc) = ComdatsChosen[SC];
14261426 C = DstM.getOrInsertComdat(SC->getName());
14271427 C->setSelectionKind(SK);
1428 if (SGV->hasInternalLinkage())
1428 if (SGV->hasLocalLinkage())
14291429 LinkFromSrc = true;
14301430 } else if (DGV) {
14311431 if (shouldLinkFromSource(LinkFromSrc, *DGV, *SGV))
0 $a1 = comdat any
1 @baz = private global i32 42, comdat($a1)
2 @a1 = internal alias i32, i32* @baz
3 define i32* @abc() {
4 ret i32* @a1
5 }
0 ; RUN: llvm-link -S %s %p/Inputs/comdat15.ll -o - | FileCheck %s
1
2 $a1 = comdat any
3 @bar = global i32 0, comdat($a1)
4
5 ; CHECK: @bar = global i32 0, comdat($a1)
6 ; CHECK: @baz = private global i32 42, comdat($a1)
7 ; CHECK: @a1 = internal alias i32, i32* @baz
8