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

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

Issue 2542903003: [Interpreter] Templatize AccumulatorUsage and OperandType for bytecode creation. (Closed)
Patch Set: Remove commented code and rebase Created 4 years 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 | « test/unittests/BUILD.gn ('k') | test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/interpreter/bytecode-operands-unittest.cc
diff --git a/test/unittests/interpreter/bytecode-operands-unittest.cc b/test/unittests/interpreter/bytecode-operands-unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a02d7f01c6599abe2e5442190d6938e9d5c7221b
--- /dev/null
+++ b/test/unittests/interpreter/bytecode-operands-unittest.cc
@@ -0,0 +1,47 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/v8.h"
+
+#include "src/interpreter/bytecode-operands.h"
+#include "src/isolate.h"
+#include "test/unittests/test-utils.h"
+
+namespace v8 {
+namespace internal {
+namespace interpreter {
+
+using BytecodeOperandsTest = TestWithIsolateAndZone;
+
+TEST(BytecodeOperandsTest, IsScalableSignedByte) {
+#define SCALABLE_SIGNED_OPERAND(Name, ...) \
+ CHECK(BytecodeOperands::IsScalableSignedByte(OperandType::k##Name));
+ REGISTER_OPERAND_TYPE_LIST(SCALABLE_SIGNED_OPERAND)
+ SIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(SCALABLE_SIGNED_OPERAND)
+#undef SCALABLE_SIGNED_OPERAND
+#define NOT_SCALABLE_SIGNED_OPERAND(Name, ...) \
+ CHECK(!BytecodeOperands::IsScalableSignedByte(OperandType::k##Name));
+ INVALID_OPERAND_TYPE_LIST(NOT_SCALABLE_SIGNED_OPERAND)
+ UNSIGNED_FIXED_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_SIGNED_OPERAND)
+ UNSIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_SIGNED_OPERAND)
+#undef NOT_SCALABLE_SIGNED_OPERAND
+}
+
+TEST(BytecodeOperandsTest, IsScalableUnsignedByte) {
+#define SCALABLE_UNSIGNED_OPERAND(Name, ...) \
+ CHECK(BytecodeOperands::IsScalableUnsignedByte(OperandType::k##Name));
+ UNSIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(SCALABLE_UNSIGNED_OPERAND)
+#undef SCALABLE_SIGNED_OPERAND
+#define NOT_SCALABLE_UNSIGNED_OPERAND(Name, ...) \
+ CHECK(!BytecodeOperands::IsScalableUnsignedByte(OperandType::k##Name));
+ INVALID_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
+ REGISTER_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
+ SIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
+ UNSIGNED_FIXED_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
+#undef NOT_SCALABLE_SIGNED_OPERAND
+}
+
+} // namespace interpreter
+} // namespace internal
+} // namespace v8
« no previous file with comments | « test/unittests/BUILD.gn ('k') | test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698