llvm.org GIT mirror llvm / f5ec9b5
The 'expected' argument to EXPECT_EQ is actually the first one; flip these tests around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138708 91177308-0d34-0410-b5e6-96231b3b80d8 John McCall 9 years ago
1 changed file(s) with 23 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
2828 IntegerType* Int1 = IntegerType::get(C, 1);
2929 Constant* One = ConstantInt::get(Int1, 1, true);
3030 const ReturnInst* r1 = ReturnInst::Create(C, One);
31 EXPECT_EQ(r1->getNumOperands(), 1U);
31 EXPECT_EQ(1U, r1->getNumOperands());
3232 User::const_op_iterator b(r1->op_begin());
33 EXPECT_NE(b, r1->op_end());
34 EXPECT_EQ(*b, One);
35 EXPECT_EQ(r1->getOperand(0), One);
33 EXPECT_NE(r1->op_end(), b);
34 EXPECT_EQ(One, *b);
35 EXPECT_EQ(One, r1->getOperand(0));
3636 ++b;
37 EXPECT_EQ(b, r1->op_end());
37 EXPECT_EQ(r1->op_end(), b);
3838
3939 // clean up
4040 delete r0;
5353
5454 EXPECT_TRUE(b0->isUnconditional());
5555 EXPECT_FALSE(b0->isConditional());
56 EXPECT_EQ(b0->getNumSuccessors(), 1U);
56 EXPECT_EQ(1U, b0->getNumSuccessors());
5757
5858 // check num operands
59 EXPECT_EQ(b0->getNumOperands(), 1U);
59 EXPECT_EQ(1U, b0->getNumOperands());
6060
6161 EXPECT_NE(b0->op_begin(), b0->op_end());
62 EXPECT_EQ(llvm::next(b0->op_begin()), b0->op_end());
62 EXPECT_EQ(b0->op_end(), llvm::next(b0->op_begin()));
6363
64 EXPECT_EQ(llvm::next(b0->op_begin()), b0->op_end());
64 EXPECT_EQ(b0->op_end(), llvm::next(b0->op_begin()));
6565
6666 IntegerType* Int1 = IntegerType::get(C, 1);
6767 Constant* One = ConstantInt::get(Int1, 1, true);
7171
7272 EXPECT_FALSE(b1->isUnconditional());
7373 EXPECT_TRUE(b1->isConditional());
74 EXPECT_EQ(b1->getNumSuccessors(), 2U);
74 EXPECT_EQ(2U, b1->getNumSuccessors());
7575
7676 // check num operands
77 EXPECT_EQ(b1->getNumOperands(), 3U);
77 EXPECT_EQ(3U, b1->getNumOperands());
7878
7979 User::const_op_iterator b(b1->op_begin());
8080
8181 // check COND
8282 EXPECT_NE(b, b1->op_end());
83 EXPECT_EQ(*b, One);
84 EXPECT_EQ(b1->getOperand(0), One);
85 EXPECT_EQ(b1->getCondition(), One);
83 EXPECT_EQ(One, *b);
84 EXPECT_EQ(One, b1->getOperand(0));
85 EXPECT_EQ(One, b1->getCondition());
8686 ++b;
8787
8888 // check ELSE
89 EXPECT_EQ(*b, bb1);
90 EXPECT_EQ(b1->getOperand(1), bb1);
91 EXPECT_EQ(b1->getSuccessor(1), bb1);
89 EXPECT_EQ(bb1, *b);
90 EXPECT_EQ(bb1, b1->getOperand(1));
91 EXPECT_EQ(bb1, b1->getSuccessor(1));
9292 ++b;
9393
9494 // check THEN
95 EXPECT_EQ(*b, bb0);
96 EXPECT_EQ(b1->getOperand(2), bb0);
97 EXPECT_EQ(b1->getSuccessor(0), bb0);
95 EXPECT_EQ(bb0, *b);
96 EXPECT_EQ(bb0, b1->getOperand(2));
97 EXPECT_EQ(bb0, b1->getSuccessor(0));
9898 ++b;
9999
100 EXPECT_EQ(b, b1->op_end());
100 EXPECT_EQ(b1->op_end(), b);
101101
102102 // clean up
103103 delete b0;
124124 EXPECT_FALSE(CastInst::isCastable(Int64Ty, X86MMXTy));
125125 EXPECT_TRUE(CastInst::isCastable(V8x64Ty, V8x8Ty));
126126 EXPECT_TRUE(CastInst::isCastable(V8x8Ty, V8x64Ty));
127 EXPECT_EQ(CastInst::getCastOpcode(c64, true, V8x8Ty, true), CastInst::Trunc);
128 EXPECT_EQ(CastInst::getCastOpcode(c8, true, V8x64Ty, true), CastInst::SExt);
127 EXPECT_EQ(CastInst::Trunc, CastInst::getCastOpcode(c64, true, V8x8Ty, true));
128 EXPECT_EQ(CastInst::SExt, CastInst::getCastOpcode(c8, true, V8x64Ty, true));
129129 }
130130
131131 } // end anonymous namespace