Fix lazy linking of comdat members.

If not for lazy linking of linkonce GVs, comdats are just a
preprocessing before symbol resolution.

Lazy linking complicates it since when we pick a visible member of
comdat, we have to make sure the rest of it passes symbol resolution
too.

llvm-svn: 264223
diff --git a/llvm/test/Linker/comdat9.ll b/llvm/test/Linker/comdat9.ll
index 4f6f2cf..6f177e6 100644
--- a/llvm/test/Linker/comdat9.ll
+++ b/llvm/test/Linker/comdat9.ll
@@ -11,7 +11,7 @@
 ; CHECK-DAG: define internal void @f() comdat($c)
 
 $f2 = comdat largest
-define internal void @f2() comdat($f2) {
+define linkonce_odr void @f2() comdat($f2) {
   ret void
 }
 define void @f3() comdat($f2) {
@@ -19,4 +19,4 @@
 }
 
 ; CHECK-DAG: $f2 = comdat largest
-; CHECK-DAG: define internal void @f2() comdat {
+; CHECK-DAG: define linkonce_odr void @f2()