diff options
Diffstat (limited to 'compiler/optimizing/constant_folding_test.cc')
-rw-r--r-- | compiler/optimizing/constant_folding_test.cc | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/compiler/optimizing/constant_folding_test.cc b/compiler/optimizing/constant_folding_test.cc index 4573dce4aa..741fd3f822 100644 --- a/compiler/optimizing/constant_folding_test.cc +++ b/compiler/optimizing/constant_folding_test.cc @@ -128,8 +128,7 @@ TEST_F(ConstantFoldingTest, IntConstantFoldingNegation) { auto check_after_cf = [](HGraph* graph) { HInstruction* inst = graph->GetBlocks()[1]->GetFirstInstruction()->InputAt(0); ASSERT_TRUE(inst->IsIntConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst->AsIntConstantOrNull()->GetValue(), -1); + ASSERT_EQ(inst->AsIntConstant()->GetValue(), -1); }; // Expected difference after dead code elimination. @@ -190,8 +189,7 @@ TEST_F(ConstantFoldingTest, LongConstantFoldingNegation) { auto check_after_cf = [](HGraph* graph) { HInstruction* inst = graph->GetBlocks()[1]->GetFirstInstruction()->InputAt(0); ASSERT_TRUE(inst->IsLongConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst->AsLongConstantOrNull()->GetValue(), INT64_C(-4294967296)); + ASSERT_EQ(inst->AsLongConstant()->GetValue(), INT64_C(-4294967296)); }; // Expected difference after dead code elimination. @@ -252,8 +250,7 @@ TEST_F(ConstantFoldingTest, IntConstantFoldingOnAddition1) { auto check_after_cf = [](HGraph* graph) { HInstruction* inst = graph->GetBlocks()[1]->GetFirstInstruction()->InputAt(0); ASSERT_TRUE(inst->IsIntConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst->AsIntConstantOrNull()->GetValue(), 3); + ASSERT_EQ(inst->AsIntConstant()->GetValue(), 3); }; // Expected difference after dead code elimination. @@ -332,16 +329,13 @@ TEST_F(ConstantFoldingTest, IntConstantFoldingOnAddition2) { auto check_after_cf = [](HGraph* graph) { HInstruction* inst1 = graph->GetBlocks()[1]->GetFirstInstruction()->InputAt(0); ASSERT_TRUE(inst1->IsIntConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst1->AsIntConstantOrNull()->GetValue(), 12); + ASSERT_EQ(inst1->AsIntConstant()->GetValue(), 12); HInstruction* inst2 = inst1->GetPrevious(); ASSERT_TRUE(inst2->IsIntConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst2->AsIntConstantOrNull()->GetValue(), 9); + ASSERT_EQ(inst2->AsIntConstant()->GetValue(), 9); HInstruction* inst3 = inst2->GetPrevious(); ASSERT_TRUE(inst3->IsIntConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst3->AsIntConstantOrNull()->GetValue(), 3); + ASSERT_EQ(inst3->AsIntConstant()->GetValue(), 3); }; // Expected difference after dead code elimination. @@ -406,8 +400,7 @@ TEST_F(ConstantFoldingTest, IntConstantFoldingOnSubtraction) { auto check_after_cf = [](HGraph* graph) { HInstruction* inst = graph->GetBlocks()[1]->GetFirstInstruction()->InputAt(0); ASSERT_TRUE(inst->IsIntConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst->AsIntConstantOrNull()->GetValue(), 1); + ASSERT_EQ(inst->AsIntConstant()->GetValue(), 1); }; // Expected difference after dead code elimination. @@ -470,8 +463,7 @@ TEST_F(ConstantFoldingTest, LongConstantFoldingOnAddition) { auto check_after_cf = [](HGraph* graph) { HInstruction* inst = graph->GetBlocks()[1]->GetFirstInstruction()->InputAt(0); ASSERT_TRUE(inst->IsLongConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst->AsLongConstantOrNull()->GetValue(), 3); + ASSERT_EQ(inst->AsLongConstant()->GetValue(), 3); }; // Expected difference after dead code elimination. @@ -535,8 +527,7 @@ TEST_F(ConstantFoldingTest, LongConstantFoldingOnSubtraction) { auto check_after_cf = [](HGraph* graph) { HInstruction* inst = graph->GetBlocks()[1]->GetFirstInstruction()->InputAt(0); ASSERT_TRUE(inst->IsLongConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst->AsLongConstantOrNull()->GetValue(), 1); + ASSERT_EQ(inst->AsLongConstant()->GetValue(), 1); }; // Expected difference after dead code elimination. @@ -636,20 +627,16 @@ TEST_F(ConstantFoldingTest, IntConstantFoldingAndJumps) { auto check_after_cf = [](HGraph* graph) { HInstruction* inst1 = graph->GetBlocks()[4]->GetFirstInstruction()->InputAt(0); ASSERT_TRUE(inst1->IsIntConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst1->AsIntConstantOrNull()->GetValue(), 20); + ASSERT_EQ(inst1->AsIntConstant()->GetValue(), 20); HInstruction* inst2 = inst1->GetPrevious(); ASSERT_TRUE(inst2->IsIntConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst2->AsIntConstantOrNull()->GetValue(), 12); + ASSERT_EQ(inst2->AsIntConstant()->GetValue(), 12); HInstruction* inst3 = inst2->GetPrevious(); ASSERT_TRUE(inst3->IsIntConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst3->AsIntConstantOrNull()->GetValue(), 7); + ASSERT_EQ(inst3->AsIntConstant()->GetValue(), 7); HInstruction* inst4 = inst3->GetPrevious(); ASSERT_TRUE(inst4->IsIntConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst4->AsIntConstantOrNull()->GetValue(), 3); + ASSERT_EQ(inst4->AsIntConstant()->GetValue(), 3); }; // Expected difference after dead code elimination. @@ -725,8 +712,7 @@ TEST_F(ConstantFoldingTest, ConstantCondition) { auto check_after_cf = [](HGraph* graph) { HInstruction* inst = graph->GetBlocks()[1]->GetFirstInstruction()->InputAt(0); ASSERT_TRUE(inst->IsIntConstant()); - // TODO: Remove "OrNull". - ASSERT_EQ(inst->AsIntConstantOrNull()->GetValue(), 1); + ASSERT_EQ(inst->AsIntConstant()->GetValue(), 1); }; // Expected graph after dead code elimination. |