aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/IR/InstructionsTest.cpp
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2015-04-10 22:08:18 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-10 22:08:18 +0000
commit13a7db5b9c4f5e543d037be68ec3428216bfd550 (patch)
tree1b2c9792582e12f5af0b1512e3094425f0dc0df9 /unittests/IR/InstructionsTest.cpp
parent0eb46f5d1e06a4284663d636a74b06adc3a161d7 (diff)
parent31195f0bdca6ee2a5e72d07edf13e1d81206d949 (diff)
downloadexternal_llvm-13a7db5b9c4f5e543d037be68ec3428216bfd550.zip
external_llvm-13a7db5b9c4f5e543d037be68ec3428216bfd550.tar.gz
external_llvm-13a7db5b9c4f5e543d037be68ec3428216bfd550.tar.bz2
am 31195f0b: Merge "Update aosp/master llvm for rebase to r233350"
* commit '31195f0bdca6ee2a5e72d07edf13e1d81206d949': Update aosp/master llvm for rebase to r233350
Diffstat (limited to 'unittests/IR/InstructionsTest.cpp')
-rw-r--r--unittests/IR/InstructionsTest.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/unittests/IR/InstructionsTest.cpp b/unittests/IR/InstructionsTest.cpp
index 7ec9b62..3ca3ad2 100644
--- a/unittests/IR/InstructionsTest.cpp
+++ b/unittests/IR/InstructionsTest.cpp
@@ -291,8 +291,10 @@ TEST(InstructionsTest, VectorGep) {
LLVMContext &C(getGlobalContext());
// Type Definitions
- PointerType *Ptri8Ty = PointerType::get(IntegerType::get(C, 8), 0);
- PointerType *Ptri32Ty = PointerType::get(IntegerType::get(C, 32), 0);
+ Type *I8Ty = IntegerType::get(C, 8);
+ Type *I32Ty = IntegerType::get(C, 32);
+ PointerType *Ptri8Ty = PointerType::get(I8Ty, 0);
+ PointerType *Ptri32Ty = PointerType::get(I32Ty, 0);
VectorType *V2xi8PTy = VectorType::get(Ptri8Ty, 2);
VectorType *V2xi32PTy = VectorType::get(Ptri32Ty, 2);
@@ -318,10 +320,10 @@ TEST(InstructionsTest, VectorGep) {
ICmpInst *ICmp2 = new ICmpInst(*BB0, ICmpInst::ICMP_SGE, PtrVecA, PtrVecB);
EXPECT_NE(ICmp0, ICmp2); // suppress warning.
- GetElementPtrInst *Gep0 = GetElementPtrInst::Create(PtrVecA, C2xi32a);
- GetElementPtrInst *Gep1 = GetElementPtrInst::Create(PtrVecA, C2xi32b);
- GetElementPtrInst *Gep2 = GetElementPtrInst::Create(PtrVecB, C2xi32a);
- GetElementPtrInst *Gep3 = GetElementPtrInst::Create(PtrVecB, C2xi32b);
+ GetElementPtrInst *Gep0 = GetElementPtrInst::Create(I32Ty, PtrVecA, C2xi32a);
+ GetElementPtrInst *Gep1 = GetElementPtrInst::Create(I32Ty, PtrVecA, C2xi32b);
+ GetElementPtrInst *Gep2 = GetElementPtrInst::Create(I32Ty, PtrVecB, C2xi32a);
+ GetElementPtrInst *Gep3 = GetElementPtrInst::Create(I32Ty, PtrVecB, C2xi32b);
CastInst *BTC0 = new BitCastInst(Gep0, V2xi8PTy);
CastInst *BTC1 = new BitCastInst(Gep1, V2xi8PTy);
@@ -343,16 +345,16 @@ TEST(InstructionsTest, VectorGep) {
"2:32:32-f64:64:64-v64:64:64-v128:128:128-a:0:64-s:64:64-f80"
":128:128-n8:16:32:64-S128");
// Make sure we don't crash
- GetPointerBaseWithConstantOffset(Gep0, Offset, &TD);
- GetPointerBaseWithConstantOffset(Gep1, Offset, &TD);
- GetPointerBaseWithConstantOffset(Gep2, Offset, &TD);
- GetPointerBaseWithConstantOffset(Gep3, Offset, &TD);
+ GetPointerBaseWithConstantOffset(Gep0, Offset, TD);
+ GetPointerBaseWithConstantOffset(Gep1, Offset, TD);
+ GetPointerBaseWithConstantOffset(Gep2, Offset, TD);
+ GetPointerBaseWithConstantOffset(Gep3, Offset, TD);
// Gep of Geps
- GetElementPtrInst *GepII0 = GetElementPtrInst::Create(Gep0, C2xi32b);
- GetElementPtrInst *GepII1 = GetElementPtrInst::Create(Gep1, C2xi32a);
- GetElementPtrInst *GepII2 = GetElementPtrInst::Create(Gep2, C2xi32b);
- GetElementPtrInst *GepII3 = GetElementPtrInst::Create(Gep3, C2xi32a);
+ GetElementPtrInst *GepII0 = GetElementPtrInst::Create(I32Ty, Gep0, C2xi32b);
+ GetElementPtrInst *GepII1 = GetElementPtrInst::Create(I32Ty, Gep1, C2xi32a);
+ GetElementPtrInst *GepII2 = GetElementPtrInst::Create(I32Ty, Gep2, C2xi32b);
+ GetElementPtrInst *GepII3 = GetElementPtrInst::Create(I32Ty, Gep3, C2xi32a);
EXPECT_EQ(GepII0->getNumIndices(), 1u);
EXPECT_EQ(GepII1->getNumIndices(), 1u);