summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Linker/LinkModules.cpp2
-rw-r--r--test/Linker/testlink1.ll6
-rw-r--r--test/Linker/testlink2.ll3
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp
index e973919de3..41ec114a75 100644
--- a/lib/Linker/LinkModules.cpp
+++ b/lib/Linker/LinkModules.cpp
@@ -180,7 +180,7 @@ bool TypeMapTy::areTypesIsomorphic(Type *DstTy, Type *SrcTy) {
if (DATy->getNumElements() != cast<ArrayType>(SrcTy)->getNumElements())
return false;
} else if (VectorType *DVTy = dyn_cast<VectorType>(DstTy)) {
- if (DVTy->getNumElements() != cast<ArrayType>(SrcTy)->getNumElements())
+ if (DVTy->getNumElements() != cast<VectorType>(SrcTy)->getNumElements())
return false;
}
diff --git a/test/Linker/testlink1.ll b/test/Linker/testlink1.ll
index a8746379b6..6ba6fd5fd7 100644
--- a/test/Linker/testlink1.ll
+++ b/test/Linker/testlink1.ll
@@ -13,6 +13,10 @@
; The uses of intlist in the other file should be remapped.
; CHECK-NOT: {{%intlist.[0-9]}}
+; CHECK: %VecSize = type { <5 x i32> }
+; CHECK: %VecSize.{{[0-9]}} = type { <10 x i32> }
+%VecSize = type { <5 x i32> }
+
%Struct1 = type opaque
@S1GV = external global %Struct1*
@@ -93,3 +97,5 @@ define internal void @Testintern() {
define void @testIntern() {
ret void
}
+
+declare void @VecSizeCrash(%VecSize)
diff --git a/test/Linker/testlink2.ll b/test/Linker/testlink2.ll
index 1798e31e47..ff8e529986 100644
--- a/test/Linker/testlink2.ll
+++ b/test/Linker/testlink2.ll
@@ -8,6 +8,8 @@
%Ty1 = type { %Ty2* }
%Ty2 = type opaque
+%VecSize = type { <10 x i32> }
+
@GVTy1 = global %Ty1* null
@GVTy2 = external global %Ty2*
@@ -53,3 +55,4 @@ define internal void @testIntern() {
ret void
}
+declare void @VecSizeCrash1(%VecSize)