Line data Source code
1 : // Copyright 2016 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #include "src/v8.h"
6 :
7 : #include "src/interpreter/bytecode-operands.h"
8 : #include "src/isolate.h"
9 : #include "test/unittests/test-utils.h"
10 :
11 : namespace v8 {
12 : namespace internal {
13 : namespace interpreter {
14 :
15 : using BytecodeOperandsTest = TestWithIsolateAndZone;
16 :
17 15188 : TEST(BytecodeOperandsTest, IsScalableSignedByte) {
18 : #define SCALABLE_SIGNED_OPERAND(Name, ...) \
19 : CHECK(BytecodeOperands::IsScalableSignedByte(OperandType::k##Name));
20 : REGISTER_OPERAND_TYPE_LIST(SCALABLE_SIGNED_OPERAND)
21 : SIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(SCALABLE_SIGNED_OPERAND)
22 : #undef SCALABLE_SIGNED_OPERAND
23 : #define NOT_SCALABLE_SIGNED_OPERAND(Name, ...) \
24 : CHECK(!BytecodeOperands::IsScalableSignedByte(OperandType::k##Name));
25 : INVALID_OPERAND_TYPE_LIST(NOT_SCALABLE_SIGNED_OPERAND)
26 : UNSIGNED_FIXED_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_SIGNED_OPERAND)
27 : UNSIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_SIGNED_OPERAND)
28 : #undef NOT_SCALABLE_SIGNED_OPERAND
29 1 : }
30 :
31 15188 : TEST(BytecodeOperandsTest, IsScalableUnsignedByte) {
32 : #define SCALABLE_UNSIGNED_OPERAND(Name, ...) \
33 : CHECK(BytecodeOperands::IsScalableUnsignedByte(OperandType::k##Name));
34 : UNSIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(SCALABLE_UNSIGNED_OPERAND)
35 : #undef SCALABLE_SIGNED_OPERAND
36 : #define NOT_SCALABLE_UNSIGNED_OPERAND(Name, ...) \
37 : CHECK(!BytecodeOperands::IsScalableUnsignedByte(OperandType::k##Name));
38 : INVALID_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
39 : REGISTER_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
40 : SIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
41 : UNSIGNED_FIXED_SCALAR_OPERAND_TYPE_LIST(NOT_SCALABLE_UNSIGNED_OPERAND)
42 : #undef NOT_SCALABLE_SIGNED_OPERAND
43 1 : }
44 :
45 : } // namespace interpreter
46 : } // namespace internal
47 9111 : } // namespace v8
|