summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/dead_code_elimination_test.cc
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2015-04-24 17:04:38 +0100
committerDavid Brazdil <dbrazdil@google.com>2015-04-24 17:08:39 +0100
commit1c533c17baff841e383a539fdd3c0a65135181b0 (patch)
tree8205b23a4914b58d4cdac6d33e08d85a6c2585aa /compiler/optimizing/dead_code_elimination_test.cc
parent2d7352ba5311b8f57427b91b7a891e61497373c1 (diff)
downloadart-1c533c17baff841e383a539fdd3c0a65135181b0.tar.gz
art-1c533c17baff841e383a539fdd3c0a65135181b0.tar.bz2
art-1c533c17baff841e383a539fdd3c0a65135181b0.zip
ART: Fix gtests broken by dead block elimination
Change-Id: If5de97f928f9e214d64871eabfbfb3f2d15451b7
Diffstat (limited to 'compiler/optimizing/dead_code_elimination_test.cc')
-rw-r--r--compiler/optimizing/dead_code_elimination_test.cc33
1 files changed, 19 insertions, 14 deletions
diff --git a/compiler/optimizing/dead_code_elimination_test.cc b/compiler/optimizing/dead_code_elimination_test.cc
index 98ae1ec5d3..3209d3eb18 100644
--- a/compiler/optimizing/dead_code_elimination_test.cc
+++ b/compiler/optimizing/dead_code_elimination_test.cc
@@ -169,20 +169,25 @@ TEST(DeadCodeElimination, AdditionsAndInconditionalJumps) {
"BasicBlock 5, pred: 4\n"
" 28: Exit\n";
- // Expected difference after dead code elimination.
- diff_t expected_diff = {
- { " 13: IntConstant [14]\n", removed },
- { " 24: IntConstant [25]\n", removed },
- { " 14: Add(19, 13) [25]\n", removed },
- // The SuspendCheck instruction following this Add instruction
- // inserts the latter in an environment, thus making it "used" and
- // therefore non removable. It ensues that some other Add and
- // IntConstant instructions cannot be removed, as they are direct
- // or indirect inputs of the initial Add instruction.
- { " 19: Add(9, 18) [14]\n", " 19: Add(9, 18) []\n" },
- { " 25: Add(14, 24)\n", removed },
- };
- std::string expected_after = Patch(expected_before, expected_diff);
+ // The SuspendCheck instruction following this Add instruction
+ // inserts the latter in an environment, thus making it "used" and
+ // therefore non removable. It ensures that some other Add and
+ // IntConstant instructions cannot be removed, as they are direct
+ // or indirect inputs of the initial Add instruction.
+ std::string expected_after =
+ "BasicBlock 0, succ: 1\n"
+ " 3: IntConstant [9]\n"
+ " 5: IntConstant [9]\n"
+ " 18: IntConstant [19]\n"
+ " 29: SuspendCheck\n"
+ " 30: Goto 1\n"
+ "BasicBlock 1, pred: 0, succ: 5\n"
+ " 9: Add(3, 5) [19]\n"
+ " 19: Add(9, 18) []\n"
+ " 21: SuspendCheck\n"
+ " 27: ReturnVoid\n"
+ "BasicBlock 5, pred: 1\n"
+ " 28: Exit\n";
TestCode(data, expected_before, expected_after);
}