summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2014-09-15 14:07:15 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2014-09-15 14:08:08 +0100
commit58bdd18fb060979c22a1fd1a15c2efdcdd19c1c5 (patch)
tree549868bad01309e7bac56b021f4551e852f668de
parent1c52115647f7bfac016ed47d3ee4d70078f9c074 (diff)
Add tests for IF_EQZ for suspend checks.
Also remove leftover debugging. Change-Id: If7d3119bc03b9ad6c1228fbde781162d0e62753f
-rw-r--r--compiler/optimizing/builder.cc1
-rw-r--r--compiler/optimizing/suspend_check_test.cc18
2 files changed, 18 insertions, 1 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index 71e71f79d4..cbdaec63de 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -164,7 +164,6 @@ void HGraphBuilder::If_21t(const Instruction& instruction, uint32_t dex_offset)
current_block_->AddInstruction(comparison);
HInstruction* ifinst = new (arena_) HIf(comparison);
current_block_->AddInstruction(ifinst);
- fprintf(stderr, "%d and %d\n", dex_offset, target_offset);
HBasicBlock* target = FindBlockStartingAt(dex_offset + target_offset);
DCHECK(target != nullptr);
current_block_->AddSuccessor(target);
diff --git a/compiler/optimizing/suspend_check_test.cc b/compiler/optimizing/suspend_check_test.cc
index 65fc2d8e85..2e48ee8e7e 100644
--- a/compiler/optimizing/suspend_check_test.cc
+++ b/compiler/optimizing/suspend_check_test.cc
@@ -74,4 +74,22 @@ TEST(CodegenTest, CFG4) {
TestCode(data);
}
+
+TEST(CodegenTest, CFG5) {
+ const uint16_t data[] = ONE_REGISTER_CODE_ITEM(
+ Instruction::CONST_4 | 0 | 0,
+ Instruction::IF_EQZ, 0xFFFF,
+ Instruction::RETURN_VOID);
+
+ TestCode(data);
+}
+
+TEST(CodegenTest, CFG6) {
+ const uint16_t data[] = ONE_REGISTER_CODE_ITEM(
+ Instruction::CONST_4 | 0 | 0,
+ Instruction::IF_NEZ, 0xFFFF,
+ Instruction::RETURN_VOID);
+
+ TestCode(data);
+}
} // namespace art