llvm.org GIT mirror llvm / 9127334
Error on linking appending globals with different unnamed_addr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189950 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
3 changed file(s) with 13 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
703703 if (DstGV->getVisibility() != SrcGV->getVisibility())
704704 return emitError(
705705 "Appending variables with different visibility need to be linked!");
706
706
707 if (DstGV->hasUnnamedAddr() != SrcGV->hasUnnamedAddr())
708 return emitError(
709 "Appending variables with different unnamed_addr need to be linked!");
710
707711 if (DstGV->getSection() != SrcGV->getSection())
708712 return emitError(
709713 "Appending variables with different section name need to be linked!");
0 ; RUN: not llvm-link %s %p/unnamed-addr-err-b.ll -S -o - 2>&1 | FileCheck %s
1
2 @foo = appending unnamed_addr global [1 x i32] [i32 42]
3 ; CHECK: Appending variables with different unnamed_addr need to be linked
0 ; This file is for use with unnamed-addr-err-a.ll
1 ; RUN: true
2
3 @foo = appending global [1 x i32] [i32 42]