Fix a copy/paste error in the IR Linker, casting an ArrayType instead of a VectorType.
authorJoey Gouly <joey.gouly@arm.com>
Thu, 10 Jan 2013 10:49:36 +0000 (10:49 +0000)
committerJoey Gouly <joey.gouly@arm.com>
Thu, 10 Jan 2013 10:49:36 +0000 (10:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172054 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp
test/Linker/testlink1.ll
test/Linker/testlink2.ll

index e973919de393a47c90c5ba14c1fe2c8dd703d1e0..41ec114a75f6ecb08d26f934efb40ffdeb7b271a 100644 (file)
@@ -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;
   }
 
index a8746379b6cf14414b6914d68246c4dc16174a32..6ba6fd5fd7e9575a502163ceb195f25ab7ef171a 100644 (file)
 ; 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)
index 1798e31e47dca8169e09f0b2abad85f6c4ac6a62..ff8e5299869a566d6c5f42589f6c3202f958da8b 100644 (file)
@@ -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)