Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Unified Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 1294523002: [Interpreter] Register conversion fix and test. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/interpreter/bytecode-array-builder-unittest.cc
diff --git a/test/unittests/interpreter/bytecode-array-builder-unittest.cc b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
index ac46ec0ec7ea65b31876800f862f862d93a877f8..aead34770c6516c1d98bc2fc2fd51d3e71b2dfc2 100644
--- a/test/unittests/interpreter/bytecode-array-builder-unittest.cc
+++ b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
@@ -117,6 +117,21 @@ TEST_F(BytecodeArrayBuilderTest, TemporariesRecycled) {
CHECK_EQ(first, second);
}
+
+TEST_F(BytecodeArrayBuilderTest, RegisterValues) {
+ int index = 1;
+ uint8_t operand = static_cast<uint8_t>(-index);
+
+ Register the_register(index);
+ CHECK_EQ(the_register.index(), index);
+
+ int actual_operand = the_register.ToOperand();
+ CHECK_EQ(actual_operand, operand);
+
+ int actual_index = Register::FromOperand(actual_operand).index();
+ CHECK_EQ(actual_index, index);
+}
+
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698