git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255272
91177308-0d34-0410-b5e6-
96231b3b80d8
if (SGV.isDeclaration())
return true;
- if (DGV->isDeclarationForLinker())
+ if (DGV->isDeclarationForLinker() && !SGV.isDeclarationForLinker())
return false;
if (ShouldLink)
@h = global void ()* @f
+@h2 = global void ()* @g
define available_externally void @f() {
ret void
}
+
+define available_externally void @g() {
+ ret void
+}
declare void @f()
+define available_externally void @g() {
+ ret void
+}
+
define void ()* @main() {
+ call void @g()
ret void ()* @f
}
-; CHECK: define available_externally void @f() {
+; CHECK-DAG: define available_externally void @g() {
+; CHECK-DAG: define available_externally void @f() {