forked from OSchip/llvm-project
Error on linking appending globals with different unnamed_addr.
llvm-svn: 189950
This commit is contained in:
parent
6272680119
commit
fac3a018d1
|
@ -704,7 +704,11 @@ bool ModuleLinker::linkAppendingVarProto(GlobalVariable *DstGV,
|
||||||
if (DstGV->getVisibility() != SrcGV->getVisibility())
|
if (DstGV->getVisibility() != SrcGV->getVisibility())
|
||||||
return emitError(
|
return emitError(
|
||||||
"Appending variables with different visibility need to be linked!");
|
"Appending variables with different visibility need to be linked!");
|
||||||
|
|
||||||
|
if (DstGV->hasUnnamedAddr() != SrcGV->hasUnnamedAddr())
|
||||||
|
return emitError(
|
||||||
|
"Appending variables with different unnamed_addr need to be linked!");
|
||||||
|
|
||||||
if (DstGV->getSection() != SrcGV->getSection())
|
if (DstGV->getSection() != SrcGV->getSection())
|
||||||
return emitError(
|
return emitError(
|
||||||
"Appending variables with different section name need to be linked!");
|
"Appending variables with different section name need to be linked!");
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
; RUN: not llvm-link %s %p/unnamed-addr-err-b.ll -S -o - 2>&1 | FileCheck %s
|
||||||
|
|
||||||
|
@foo = appending unnamed_addr global [1 x i32] [i32 42]
|
||||||
|
; CHECK: Appending variables with different unnamed_addr need to be linked
|
|
@ -0,0 +1,4 @@
|
||||||
|
; This file is for use with unnamed-addr-err-a.ll
|
||||||
|
; RUN: true
|
||||||
|
|
||||||
|
@foo = appending global [1 x i32] [i32 42]
|
Loading…
Reference in New Issue