Commit 9c25d5dc authored by ulan's avatar ulan Committed by Commit bot

[wasm] Fix more -Wsign-compare warnings.

BUG=v8:5614

Review-Url: https://codereview.chromium.org/2492793005
Cr-Commit-Position: refs/heads/master@{#40914}
parent fa9c25ce
...@@ -94,7 +94,7 @@ class AsmValueType { ...@@ -94,7 +94,7 @@ class AsmValueType {
} }
static AsmType* New(bitset_t bits) { static AsmType* New(bitset_t bits) {
DCHECK_EQ((bits & kAsmValueTypeTag), 0); DCHECK_EQ((bits & kAsmValueTypeTag), 0u);
return reinterpret_cast<AsmType*>( return reinterpret_cast<AsmType*>(
static_cast<uintptr_t>(bits | kAsmValueTypeTag)); static_cast<uintptr_t>(bits | kAsmValueTypeTag));
} }
......
...@@ -574,7 +574,7 @@ class WasmFullDecoder : public WasmDecoder { ...@@ -574,7 +574,7 @@ class WasmFullDecoder : public WasmDecoder {
// Decodes the locals declarations, if any, populating {local_type_vec_}. // Decodes the locals declarations, if any, populating {local_type_vec_}.
void DecodeLocalDecls() { void DecodeLocalDecls() {
DCHECK_EQ(0, local_type_vec_.size()); DCHECK_EQ(0u, local_type_vec_.size());
// Initialize {local_type_vec} from signature. // Initialize {local_type_vec} from signature.
if (sig_) { if (sig_) {
local_type_vec_.reserve(sig_->parameter_count()); local_type_vec_.reserve(sig_->parameter_count());
......
...@@ -1698,7 +1698,7 @@ class ThreadImpl : public WasmInterpreter::Thread { ...@@ -1698,7 +1698,7 @@ class ThreadImpl : public WasmInterpreter::Thread {
WasmVal PopArity(size_t arity) { WasmVal PopArity(size_t arity) {
if (arity == 0) return WasmVal(); if (arity == 0) return WasmVal();
CHECK_EQ(1, arity); CHECK_EQ(1u, arity);
return Pop(); return Pop();
} }
......
...@@ -50,7 +50,7 @@ TEST(WasmRelocationArmMemoryReference) { ...@@ -50,7 +50,7 @@ TEST(WasmRelocationArmMemoryReference) {
code->Print(os); code->Print(os);
::printf("f() = %d\n\n", ret_value); ::printf("f() = %d\n\n", ret_value);
#endif #endif
size_t offset = 1234; int offset = 1234;
// Relocating references by offset // Relocating references by offset
int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE); int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE);
...@@ -103,7 +103,7 @@ TEST(WasmRelocationArmMemorySizeReference) { ...@@ -103,7 +103,7 @@ TEST(WasmRelocationArmMemorySizeReference) {
CSignature0<int32_t> csig; CSignature0<int32_t> csig;
CodeRunner<int32_t> runnable(isolate, code, &csig); CodeRunner<int32_t> runnable(isolate, code, &csig);
int32_t ret_value = runnable.Call(); int32_t ret_value = runnable.Call();
CHECK_NE(ret_value, 0xdeadbeef); CHECK_NE(ret_value, bit_cast<int32_t>(0xdeadbeef));
#ifdef DEBUG #ifdef DEBUG
OFStream os(stdout); OFStream os(stdout);
...@@ -124,7 +124,7 @@ TEST(WasmRelocationArmMemorySizeReference) { ...@@ -124,7 +124,7 @@ TEST(WasmRelocationArmMemorySizeReference) {
} }
ret_value = runnable.Call(); ret_value = runnable.Call();
CHECK_NE(ret_value, 0xdeadbeef); CHECK_NE(ret_value, bit_cast<int32_t>(0xdeadbeef));
#ifdef DEBUG #ifdef DEBUG
code->Print(os); code->Print(os);
......
...@@ -52,7 +52,7 @@ TEST(WasmRelocationArm64MemoryReference) { ...@@ -52,7 +52,7 @@ TEST(WasmRelocationArm64MemoryReference) {
code->Print(os); code->Print(os);
::printf("f() = %" PRIx64 "\n\n", ret_value); ::printf("f() = %" PRIx64 "\n\n", ret_value);
#endif #endif
size_t offset = 1234; int offset = 1234;
// Relocating reference by offset // Relocating reference by offset
int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE); int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE);
......
...@@ -52,7 +52,7 @@ TEST(WasmRelocationX64MemoryReference) { ...@@ -52,7 +52,7 @@ TEST(WasmRelocationX64MemoryReference) {
byte* end = begin + code->instruction_size(); byte* end = begin + code->instruction_size();
disasm::Disassembler::Disassemble(stdout, begin, end); disasm::Disassembler::Disassemble(stdout, begin, end);
#endif #endif
size_t offset = 1234; int offset = 1234;
// Relocating references by offset // Relocating references by offset
int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE); int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE);
......
...@@ -300,7 +300,7 @@ WASM_EXEC_TEST(I64DivU_Trap) { ...@@ -300,7 +300,7 @@ WASM_EXEC_TEST(I64DivU_Trap) {
WasmRunner<uint64_t> r(execution_mode, MachineType::Uint64(), WasmRunner<uint64_t> r(execution_mode, MachineType::Uint64(),
MachineType::Uint64()); MachineType::Uint64());
BUILD(r, WASM_I64_DIVU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); BUILD(r, WASM_I64_DIVU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
CHECK_EQ(0, r.Call(asu64(0), asu64(100))); CHECK_EQ(0u, r.Call(asu64(0), asu64(100)));
CHECK_TRAP64(r.Call(asu64(100), asu64(0))); CHECK_TRAP64(r.Call(asu64(100), asu64(0)));
CHECK_TRAP64(r.Call(asu64(1001), asu64(0))); CHECK_TRAP64(r.Call(asu64(1001), asu64(0)));
CHECK_TRAP64(r.Call(std::numeric_limits<uint64_t>::max(), asu64(0))); CHECK_TRAP64(r.Call(std::numeric_limits<uint64_t>::max(), asu64(0)));
...@@ -371,7 +371,7 @@ WASM_EXEC_TEST(I64RemU_Trap) { ...@@ -371,7 +371,7 @@ WASM_EXEC_TEST(I64RemU_Trap) {
WasmRunner<uint64_t> r(execution_mode, MachineType::Uint64(), WasmRunner<uint64_t> r(execution_mode, MachineType::Uint64(),
MachineType::Uint64()); MachineType::Uint64());
BUILD(r, WASM_I64_REMU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); BUILD(r, WASM_I64_REMU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
CHECK_EQ(17, r.Call(asu64(217), asu64(100))); CHECK_EQ(17u, r.Call(asu64(217), asu64(100)));
CHECK_TRAP64(r.Call(asu64(100), asu64(0))); CHECK_TRAP64(r.Call(asu64(100), asu64(0)));
CHECK_TRAP64(r.Call(asu64(1001), asu64(0))); CHECK_TRAP64(r.Call(asu64(1001), asu64(0)));
CHECK_TRAP64(r.Call(std::numeric_limits<uint64_t>::max(), asu64(0))); CHECK_TRAP64(r.Call(std::numeric_limits<uint64_t>::max(), asu64(0)));
......
...@@ -237,33 +237,33 @@ WASM_EXEC_TEST(StoreMemI32_oob_asm) { ...@@ -237,33 +237,33 @@ WASM_EXEC_TEST(StoreMemI32_oob_asm) {
TEST_BODY(kExprI32AsmjsStoreMem16) \ TEST_BODY(kExprI32AsmjsStoreMem16) \
TEST_BODY(kExprI32AsmjsStoreMem) TEST_BODY(kExprI32AsmjsStoreMem)
#define INT_LOAD_TEST(OP_TYPE) \ #define INT_LOAD_TEST(OP_TYPE) \
TEST(RunWasm_AsmCheckedRelocInfo##OP_TYPE) { \ TEST(RunWasm_AsmCheckedRelocInfo##OP_TYPE) { \
TestingModule module(kExecuteCompiled); \ TestingModule module(kExecuteCompiled); \
module.origin = kAsmJsOrigin; \ module.origin = kAsmJsOrigin; \
WasmRunner<int32_t> r(&module, MachineType::Uint32()); \ WasmRunner<int32_t> r(&module, MachineType::Uint32()); \
BUILD(r, WASM_UNOP(OP_TYPE, WASM_GET_LOCAL(0))); \ BUILD(r, WASM_UNOP(OP_TYPE, WASM_GET_LOCAL(0))); \
CHECK_EQ(1, GetMatchingRelocInfoCount(module.instance->function_code[0], \ CHECK_EQ(1u, GetMatchingRelocInfoCount(module.instance->function_code[0], \
RelocInfo::WASM_MEMORY_REFERENCE)); \ RelocInfo::WASM_MEMORY_REFERENCE)); \
CHECK_NE( \ CHECK_NE( \
0, GetMatchingRelocInfoCount(module.instance->function_code[0], \ 0u, GetMatchingRelocInfoCount(module.instance->function_code[0], \
RelocInfo::WASM_MEMORY_SIZE_REFERENCE)); \ RelocInfo::WASM_MEMORY_SIZE_REFERENCE)); \
} }
FOREACH_INT_CHECKED_LOAD_OP(INT_LOAD_TEST) FOREACH_INT_CHECKED_LOAD_OP(INT_LOAD_TEST)
#define INT_STORE_TEST(OP_TYPE) \ #define INT_STORE_TEST(OP_TYPE) \
TEST(RunWasm_AsmCheckedRelocInfo##OP_TYPE) { \ TEST(RunWasm_AsmCheckedRelocInfo##OP_TYPE) { \
TestingModule module(kExecuteCompiled); \ TestingModule module(kExecuteCompiled); \
module.origin = kAsmJsOrigin; \ module.origin = kAsmJsOrigin; \
WasmRunner<int32_t> r(&module, MachineType::Uint32(), \ WasmRunner<int32_t> r(&module, MachineType::Uint32(), \
MachineType::Uint32()); \ MachineType::Uint32()); \
BUILD(r, WASM_BINOP(OP_TYPE, WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); \ BUILD(r, WASM_BINOP(OP_TYPE, WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); \
CHECK_EQ(1, GetMatchingRelocInfoCount(module.instance->function_code[0], \ CHECK_EQ(1u, GetMatchingRelocInfoCount(module.instance->function_code[0], \
RelocInfo::WASM_MEMORY_REFERENCE)); \ RelocInfo::WASM_MEMORY_REFERENCE)); \
CHECK_NE( \ CHECK_NE( \
0, GetMatchingRelocInfoCount(module.instance->function_code[0], \ 0u, GetMatchingRelocInfoCount(module.instance->function_code[0], \
RelocInfo::WASM_MEMORY_SIZE_REFERENCE)); \ RelocInfo::WASM_MEMORY_SIZE_REFERENCE)); \
} }
FOREACH_INT_CHECKED_STORE_OP(INT_STORE_TEST) FOREACH_INT_CHECKED_STORE_OP(INT_STORE_TEST)
...@@ -274,10 +274,11 @@ TEST(RunWasm_AsmCheckedLoadFloat32RelocInfo) { ...@@ -274,10 +274,11 @@ TEST(RunWasm_AsmCheckedLoadFloat32RelocInfo) {
WasmRunner<float> r(&module, MachineType::Uint32()); WasmRunner<float> r(&module, MachineType::Uint32());
BUILD(r, WASM_UNOP(kExprF32AsmjsLoadMem, WASM_GET_LOCAL(0))); BUILD(r, WASM_UNOP(kExprF32AsmjsLoadMem, WASM_GET_LOCAL(0)));
CHECK_EQ(1, GetMatchingRelocInfoCount(module.instance->function_code[0], CHECK_EQ(1u, GetMatchingRelocInfoCount(module.instance->function_code[0],
RelocInfo::WASM_MEMORY_REFERENCE)); RelocInfo::WASM_MEMORY_REFERENCE));
CHECK_NE(0, GetMatchingRelocInfoCount(module.instance->function_code[0], CHECK_NE(0u,
RelocInfo::WASM_MEMORY_SIZE_REFERENCE)); GetMatchingRelocInfoCount(module.instance->function_code[0],
RelocInfo::WASM_MEMORY_SIZE_REFERENCE));
} }
TEST(RunWasm_AsmCheckedStoreFloat32RelocInfo) { TEST(RunWasm_AsmCheckedStoreFloat32RelocInfo) {
...@@ -287,10 +288,11 @@ TEST(RunWasm_AsmCheckedStoreFloat32RelocInfo) { ...@@ -287,10 +288,11 @@ TEST(RunWasm_AsmCheckedStoreFloat32RelocInfo) {
BUILD(r, WASM_BINOP(kExprF32AsmjsStoreMem, WASM_GET_LOCAL(0), BUILD(r, WASM_BINOP(kExprF32AsmjsStoreMem, WASM_GET_LOCAL(0),
WASM_GET_LOCAL(1))); WASM_GET_LOCAL(1)));
CHECK_EQ(1, GetMatchingRelocInfoCount(module.instance->function_code[0], CHECK_EQ(1u, GetMatchingRelocInfoCount(module.instance->function_code[0],
RelocInfo::WASM_MEMORY_REFERENCE)); RelocInfo::WASM_MEMORY_REFERENCE));
CHECK_NE(0, GetMatchingRelocInfoCount(module.instance->function_code[0], CHECK_NE(0u,
RelocInfo::WASM_MEMORY_SIZE_REFERENCE)); GetMatchingRelocInfoCount(module.instance->function_code[0],
RelocInfo::WASM_MEMORY_SIZE_REFERENCE));
} }
TEST(RunWasm_AsmCheckedLoadFloat64RelocInfo) { TEST(RunWasm_AsmCheckedLoadFloat64RelocInfo) {
...@@ -299,10 +301,11 @@ TEST(RunWasm_AsmCheckedLoadFloat64RelocInfo) { ...@@ -299,10 +301,11 @@ TEST(RunWasm_AsmCheckedLoadFloat64RelocInfo) {
WasmRunner<double> r(&module, MachineType::Uint32()); WasmRunner<double> r(&module, MachineType::Uint32());
BUILD(r, WASM_UNOP(kExprF64AsmjsLoadMem, WASM_GET_LOCAL(0))); BUILD(r, WASM_UNOP(kExprF64AsmjsLoadMem, WASM_GET_LOCAL(0)));
CHECK_EQ(1, GetMatchingRelocInfoCount(module.instance->function_code[0], CHECK_EQ(1u, GetMatchingRelocInfoCount(module.instance->function_code[0],
RelocInfo::WASM_MEMORY_REFERENCE)); RelocInfo::WASM_MEMORY_REFERENCE));
CHECK_NE(0, GetMatchingRelocInfoCount(module.instance->function_code[0], CHECK_NE(0u,
RelocInfo::WASM_MEMORY_SIZE_REFERENCE)); GetMatchingRelocInfoCount(module.instance->function_code[0],
RelocInfo::WASM_MEMORY_SIZE_REFERENCE));
} }
TEST(RunWasm_AsmCheckedStoreFloat64RelocInfo) { TEST(RunWasm_AsmCheckedStoreFloat64RelocInfo) {
...@@ -312,8 +315,9 @@ TEST(RunWasm_AsmCheckedStoreFloat64RelocInfo) { ...@@ -312,8 +315,9 @@ TEST(RunWasm_AsmCheckedStoreFloat64RelocInfo) {
BUILD(r, WASM_BINOP(kExprF64AsmjsStoreMem, WASM_GET_LOCAL(0), BUILD(r, WASM_BINOP(kExprF64AsmjsStoreMem, WASM_GET_LOCAL(0),
WASM_GET_LOCAL(1))); WASM_GET_LOCAL(1)));
CHECK_EQ(1, GetMatchingRelocInfoCount(module.instance->function_code[0], CHECK_EQ(1u, GetMatchingRelocInfoCount(module.instance->function_code[0],
RelocInfo::WASM_MEMORY_REFERENCE)); RelocInfo::WASM_MEMORY_REFERENCE));
CHECK_NE(0, GetMatchingRelocInfoCount(module.instance->function_code[0], CHECK_NE(0u,
RelocInfo::WASM_MEMORY_SIZE_REFERENCE)); GetMatchingRelocInfoCount(module.instance->function_code[0],
RelocInfo::WASM_MEMORY_SIZE_REFERENCE));
} }
...@@ -429,7 +429,7 @@ void RunJSSelectAlignTest(int num_args, int num_params) { ...@@ -429,7 +429,7 @@ void RunJSSelectAlignTest(int num_args, int num_params) {
HandleScope scope(isolate); HandleScope scope(isolate);
TestingModule module; TestingModule module;
uint32_t js_index = AddJSSelector(&module, &sig, which); uint32_t js_index = AddJSSelector(&module, &sig, which);
CHECK_EQ(0, js_index); CHECK_EQ(0u, js_index);
WasmFunctionCompiler t(&sig, &module); WasmFunctionCompiler t(&sig, &module);
t.Build(&code[0], &code[end]); t.Build(&code[0], &code[end]);
......
...@@ -31,7 +31,7 @@ using namespace v8::internal::compiler; ...@@ -31,7 +31,7 @@ using namespace v8::internal::compiler;
/* global = global + p0 */ \ /* global = global + p0 */ \
BUILD(r, WASM_SET_GLOBAL(1, ADD(WASM_GET_GLOBAL(0), WASM_GET_LOCAL(0))), \ BUILD(r, WASM_SET_GLOBAL(1, ADD(WASM_GET_GLOBAL(0), WASM_GET_LOCAL(0))), \
WASM_GET_GLOBAL(0)); \ WASM_GET_GLOBAL(0)); \
CHECK_EQ(1, module.instance->function_code.size()); \ CHECK_EQ(1u, module.instance->function_code.size()); \
\ \
int filter = 1 << RelocInfo::WASM_GLOBAL_REFERENCE; \ int filter = 1 << RelocInfo::WASM_GLOBAL_REFERENCE; \
\ \
......
...@@ -1769,7 +1769,7 @@ WASM_EXEC_TEST(CheckMachIntsZero) { ...@@ -1769,7 +1769,7 @@ WASM_EXEC_TEST(CheckMachIntsZero) {
/**/ kExprI8Const, 0); // -- /**/ kExprI8Const, 0); // --
module.BlankMemory(); module.BlankMemory();
CHECK_EQ(0, r.Call((kNumElems - 1) * 4)); CHECK_EQ(0u, r.Call((kNumElems - 1) * 4));
} }
WASM_EXEC_TEST(MemF32_Sum) { WASM_EXEC_TEST(MemF32_Sum) {
...@@ -1944,7 +1944,7 @@ static void TestBuildGraphForSimpleExpression(WasmOpcode opcode) { ...@@ -1944,7 +1944,7 @@ static void TestBuildGraphForSimpleExpression(WasmOpcode opcode) {
TestBuildingGraph(&zone, &jsgraph, nullptr, sig, nullptr, code, TestBuildingGraph(&zone, &jsgraph, nullptr, sig, nullptr, code,
code + arraysize(code)); code + arraysize(code));
} else { } else {
CHECK_EQ(2, sig->parameter_count()); CHECK_EQ(2u, sig->parameter_count());
byte code[] = {WASM_NO_LOCALS, kExprGetLocal, 0, kExprGetLocal, 1, byte code[] = {WASM_NO_LOCALS, kExprGetLocal, 0, kExprGetLocal, 1,
static_cast<byte>(opcode)}; static_cast<byte>(opcode)};
TestBuildingGraph(&zone, &jsgraph, nullptr, sig, nullptr, code, TestBuildingGraph(&zone, &jsgraph, nullptr, sig, nullptr, code,
......
...@@ -100,7 +100,7 @@ class TestingModule : public ModuleEnv { ...@@ -100,7 +100,7 @@ class TestingModule : public ModuleEnv {
byte* AddMemory(uint32_t size) { byte* AddMemory(uint32_t size) {
CHECK_NULL(instance->mem_start); CHECK_NULL(instance->mem_start);
CHECK_EQ(0, instance->mem_size); CHECK_EQ(0u, instance->mem_size);
instance->mem_start = reinterpret_cast<byte*>(malloc(size)); instance->mem_start = reinterpret_cast<byte*>(malloc(size));
CHECK(instance->mem_start); CHECK(instance->mem_start);
memset(instance->mem_start, 0, size); memset(instance->mem_start, 0, size);
......
...@@ -155,7 +155,7 @@ TEST_F(AsmTypeTest, ValidateBits) { ...@@ -155,7 +155,7 @@ TEST_F(AsmTypeTest, ValidateBits) {
do { \ do { \
++total_types; \ ++total_types; \
if (AsmValueTypeParents::CamelName != 0) { \ if (AsmValueTypeParents::CamelName != 0) { \
EXPECT_NE(0, ParentsOf(AsmType::CamelName()).size()) << #CamelName; \ EXPECT_NE(0u, ParentsOf(AsmType::CamelName()).size()) << #CamelName; \
} \ } \
seen_types.insert(Type::CamelName()); \ seen_types.insert(Type::CamelName()); \
seen_numbers.insert(number); \ seen_numbers.insert(number); \
...@@ -163,7 +163,7 @@ TEST_F(AsmTypeTest, ValidateBits) { ...@@ -163,7 +163,7 @@ TEST_F(AsmTypeTest, ValidateBits) {
EXPECT_NE(0, number) << Type::CamelName()->Name(); \ EXPECT_NE(0, number) << Type::CamelName()->Name(); \
/* Inheritance cycles - unlikely, but we're paranoid and check for it */ \ /* Inheritance cycles - unlikely, but we're paranoid and check for it */ \
/* anyways.*/ \ /* anyways.*/ \
EXPECT_EQ(0, (1 << (number)) & AsmValueTypeParents::CamelName); \ EXPECT_EQ(0u, (1 << (number)) & AsmValueTypeParents::CamelName); \
} while (0); } while (0);
FOR_EACH_ASM_VALUE_TYPE_LIST(V) FOR_EACH_ASM_VALUE_TYPE_LIST(V)
#undef V #undef V
......
...@@ -2246,7 +2246,7 @@ class BranchTableIteratorTest : public TestWithZone { ...@@ -2246,7 +2246,7 @@ class BranchTableIteratorTest : public TestWithZone {
Decoder decoder(start, end); Decoder decoder(start, end);
BranchTableOperand operand(&decoder, start); BranchTableOperand operand(&decoder, start);
BranchTableIterator iterator(&decoder, operand); BranchTableIterator iterator(&decoder, operand);
EXPECT_EQ(end - start - 1, iterator.length()); EXPECT_EQ(end - start - 1u, iterator.length());
EXPECT_TRUE(decoder.ok()); EXPECT_TRUE(decoder.ok());
} }
void CheckBrTableError(const byte* start, const byte* end) { void CheckBrTableError(const byte* start, const byte* end) {
...@@ -2304,16 +2304,18 @@ class WasmOpcodeLengthTest : public TestWithZone { ...@@ -2304,16 +2304,18 @@ class WasmOpcodeLengthTest : public TestWithZone {
WasmOpcodeLengthTest() : TestWithZone() {} WasmOpcodeLengthTest() : TestWithZone() {}
}; };
#define EXPECT_LENGTH(expected, opcode) \ #define EXPECT_LENGTH(expected, opcode) \
{ \ { \
static const byte code[] = {opcode, 0, 0, 0, 0, 0, 0, 0, 0}; \ static const byte code[] = {opcode, 0, 0, 0, 0, 0, 0, 0, 0}; \
EXPECT_EQ(expected, OpcodeLength(code, code + sizeof(code))); \ EXPECT_EQ(static_cast<unsigned>(expected), \
OpcodeLength(code, code + sizeof(code))); \
} }
#define EXPECT_LENGTH_N(expected, ...) \ #define EXPECT_LENGTH_N(expected, ...) \
{ \ { \
static const byte code[] = {__VA_ARGS__}; \ static const byte code[] = {__VA_ARGS__}; \
EXPECT_EQ(expected, OpcodeLength(code, code + sizeof(code))); \ EXPECT_EQ(static_cast<unsigned>(expected), \
OpcodeLength(code, code + sizeof(code))); \
} }
TEST_F(WasmOpcodeLengthTest, Statements) { TEST_F(WasmOpcodeLengthTest, Statements) {
...@@ -2571,7 +2573,7 @@ TEST_F(LocalDeclDecoderTest, NoLocals) { ...@@ -2571,7 +2573,7 @@ TEST_F(LocalDeclDecoderTest, NoLocals) {
AstLocalDecls decls(zone()); AstLocalDecls decls(zone());
bool result = DecodeLocalDecls(decls, data, data + sizeof(data)); bool result = DecodeLocalDecls(decls, data, data + sizeof(data));
EXPECT_TRUE(result); EXPECT_TRUE(result);
EXPECT_EQ(0, decls.total_local_count); EXPECT_EQ(0u, decls.total_local_count);
} }
TEST_F(LocalDeclDecoderTest, OneLocal) { TEST_F(LocalDeclDecoderTest, OneLocal) {
...@@ -2582,10 +2584,10 @@ TEST_F(LocalDeclDecoderTest, OneLocal) { ...@@ -2582,10 +2584,10 @@ TEST_F(LocalDeclDecoderTest, OneLocal) {
AstLocalDecls decls(zone()); AstLocalDecls decls(zone());
bool result = DecodeLocalDecls(decls, data, data + sizeof(data)); bool result = DecodeLocalDecls(decls, data, data + sizeof(data));
EXPECT_TRUE(result); EXPECT_TRUE(result);
EXPECT_EQ(1, decls.total_local_count); EXPECT_EQ(1u, decls.total_local_count);
LocalTypeMap map = Expand(decls); LocalTypeMap map = Expand(decls);
EXPECT_EQ(1, map.size()); EXPECT_EQ(1u, map.size());
EXPECT_EQ(type, map[0]); EXPECT_EQ(type, map[0]);
} }
} }
...@@ -2599,10 +2601,10 @@ TEST_F(LocalDeclDecoderTest, FiveLocals) { ...@@ -2599,10 +2601,10 @@ TEST_F(LocalDeclDecoderTest, FiveLocals) {
bool result = DecodeLocalDecls(decls, data, data + sizeof(data)); bool result = DecodeLocalDecls(decls, data, data + sizeof(data));
EXPECT_TRUE(result); EXPECT_TRUE(result);
EXPECT_EQ(sizeof(data), decls.decls_encoded_size); EXPECT_EQ(sizeof(data), decls.decls_encoded_size);
EXPECT_EQ(5, decls.total_local_count); EXPECT_EQ(5u, decls.total_local_count);
LocalTypeMap map = Expand(decls); LocalTypeMap map = Expand(decls);
EXPECT_EQ(5, map.size()); EXPECT_EQ(5u, map.size());
ExpectRun(map, 0, type, 5); ExpectRun(map, 0, type, 5);
} }
} }
...@@ -2618,10 +2620,11 @@ TEST_F(LocalDeclDecoderTest, MixedLocals) { ...@@ -2618,10 +2620,11 @@ TEST_F(LocalDeclDecoderTest, MixedLocals) {
bool result = DecodeLocalDecls(decls, data, data + sizeof(data)); bool result = DecodeLocalDecls(decls, data, data + sizeof(data));
EXPECT_TRUE(result); EXPECT_TRUE(result);
EXPECT_EQ(sizeof(data), decls.decls_encoded_size); EXPECT_EQ(sizeof(data), decls.decls_encoded_size);
EXPECT_EQ(a + b + c + d, decls.total_local_count); EXPECT_EQ(static_cast<uint32_t>(a + b + c + d),
decls.total_local_count);
LocalTypeMap map = Expand(decls); LocalTypeMap map = Expand(decls);
EXPECT_EQ(a + b + c + d, map.size()); EXPECT_EQ(static_cast<uint32_t>(a + b + c + d), map.size());
size_t pos = 0; size_t pos = 0;
pos = ExpectRun(map, pos, kAstI32, a); pos = ExpectRun(map, pos, kAstI32, a);
...@@ -2647,7 +2650,7 @@ TEST_F(LocalDeclDecoderTest, UseEncoder) { ...@@ -2647,7 +2650,7 @@ TEST_F(LocalDeclDecoderTest, UseEncoder) {
AstLocalDecls decls(zone()); AstLocalDecls decls(zone());
bool result = DecodeLocalDecls(decls, data, end); bool result = DecodeLocalDecls(decls, data, end);
EXPECT_TRUE(result); EXPECT_TRUE(result);
EXPECT_EQ(5 + 1337 + 212, decls.total_local_count); EXPECT_EQ(5u + 1337u + 212u, decls.total_local_count);
LocalTypeMap map = Expand(decls); LocalTypeMap map = Expand(decls);
size_t pos = 0; size_t pos = 0;
...@@ -2699,8 +2702,8 @@ TEST_F(BytecodeIteratorTest, WithAstDecls) { ...@@ -2699,8 +2702,8 @@ TEST_F(BytecodeIteratorTest, WithAstDecls) {
AstLocalDecls decls(zone()); AstLocalDecls decls(zone());
BytecodeIterator iter(code, code + sizeof(code), &decls); BytecodeIterator iter(code, code + sizeof(code), &decls);
EXPECT_EQ(3, decls.decls_encoded_size); EXPECT_EQ(3u, decls.decls_encoded_size);
EXPECT_EQ(3, iter.pc_offset()); EXPECT_EQ(3u, iter.pc_offset());
EXPECT_TRUE(iter.has_next()); EXPECT_TRUE(iter.has_next());
EXPECT_EQ(kExprI8Const, iter.current()); EXPECT_EQ(kExprI8Const, iter.current());
iter.next(); iter.next();
......
...@@ -19,18 +19,18 @@ class DecoderTest : public TestWithZone { ...@@ -19,18 +19,18 @@ class DecoderTest : public TestWithZone {
Decoder decoder; Decoder decoder;
}; };
#define CHECK_UINT32V_INLINE(expected, expected_length, ...) \ #define CHECK_UINT32V_INLINE(expected, expected_length, ...) \
do { \ do { \
const byte data[] = {__VA_ARGS__}; \ const byte data[] = {__VA_ARGS__}; \
decoder.Reset(data, data + sizeof(data)); \ decoder.Reset(data, data + sizeof(data)); \
unsigned length; \ unsigned length; \
EXPECT_EQ(expected, \ EXPECT_EQ(static_cast<uint32_t>(expected), \
decoder.checked_read_u32v(decoder.start(), 0, &length)); \ decoder.checked_read_u32v(decoder.start(), 0, &length)); \
EXPECT_EQ(expected_length, length); \ EXPECT_EQ(static_cast<unsigned>(expected_length), length); \
EXPECT_EQ(data, decoder.pc()); \ EXPECT_EQ(data, decoder.pc()); \
EXPECT_TRUE(decoder.ok()); \ EXPECT_TRUE(decoder.ok()); \
EXPECT_EQ(expected, decoder.consume_u32v()); \ EXPECT_EQ(static_cast<uint32_t>(expected), decoder.consume_u32v()); \
EXPECT_EQ(data + expected_length, decoder.pc()); \ EXPECT_EQ(data + expected_length, decoder.pc()); \
} while (false) } while (false)
#define CHECK_INT32V_INLINE(expected, expected_length, ...) \ #define CHECK_INT32V_INLINE(expected, expected_length, ...) \
...@@ -40,7 +40,7 @@ class DecoderTest : public TestWithZone { ...@@ -40,7 +40,7 @@ class DecoderTest : public TestWithZone {
unsigned length; \ unsigned length; \
EXPECT_EQ(expected, \ EXPECT_EQ(expected, \
decoder.checked_read_i32v(decoder.start(), 0, &length)); \ decoder.checked_read_i32v(decoder.start(), 0, &length)); \
EXPECT_EQ(expected_length, length); \ EXPECT_EQ(static_cast<unsigned>(expected_length), length); \
EXPECT_EQ(data, decoder.pc()); \ EXPECT_EQ(data, decoder.pc()); \
EXPECT_TRUE(decoder.ok()); \ EXPECT_TRUE(decoder.ok()); \
EXPECT_EQ(expected, decoder.consume_i32v()); \ EXPECT_EQ(expected, decoder.consume_i32v()); \
...@@ -52,9 +52,9 @@ class DecoderTest : public TestWithZone { ...@@ -52,9 +52,9 @@ class DecoderTest : public TestWithZone {
const byte data[] = {__VA_ARGS__}; \ const byte data[] = {__VA_ARGS__}; \
decoder.Reset(data, data + sizeof(data)); \ decoder.Reset(data, data + sizeof(data)); \
unsigned length; \ unsigned length; \
EXPECT_EQ(expected, \ EXPECT_EQ(static_cast<uint64_t>(expected), \
decoder.checked_read_u64v(decoder.start(), 0, &length)); \ decoder.checked_read_u64v(decoder.start(), 0, &length)); \
EXPECT_EQ(expected_length, length); \ EXPECT_EQ(static_cast<unsigned>(expected_length), length); \
} while (false) } while (false)
#define CHECK_INT64V_INLINE(expected, expected_length, ...) \ #define CHECK_INT64V_INLINE(expected, expected_length, ...) \
...@@ -64,7 +64,7 @@ class DecoderTest : public TestWithZone { ...@@ -64,7 +64,7 @@ class DecoderTest : public TestWithZone {
unsigned length; \ unsigned length; \
EXPECT_EQ(expected, \ EXPECT_EQ(expected, \
decoder.checked_read_i64v(decoder.start(), 0, &length)); \ decoder.checked_read_i64v(decoder.start(), 0, &length)); \
EXPECT_EQ(expected_length, length); \ EXPECT_EQ(static_cast<unsigned>(expected_length), length); \
} while (false) } while (false)
TEST_F(DecoderTest, ReadU32v_OneByte) { TEST_F(DecoderTest, ReadU32v_OneByte) {
...@@ -377,7 +377,7 @@ TEST_F(DecoderTest, ReadU32v_off_end1) { ...@@ -377,7 +377,7 @@ TEST_F(DecoderTest, ReadU32v_off_end1) {
unsigned length = 0; unsigned length = 0;
decoder.Reset(data, data); decoder.Reset(data, data);
decoder.checked_read_u32v(decoder.start(), 0, &length); decoder.checked_read_u32v(decoder.start(), 0, &length);
EXPECT_EQ(0, length); EXPECT_EQ(0u, length);
EXPECT_FALSE(decoder.ok()); EXPECT_FALSE(decoder.ok());
} }
...@@ -432,7 +432,7 @@ TEST_F(DecoderTest, ReadU32v_extra_bits) { ...@@ -432,7 +432,7 @@ TEST_F(DecoderTest, ReadU32v_extra_bits) {
unsigned length = 0; unsigned length = 0;
decoder.Reset(data, data + sizeof(data)); decoder.Reset(data, data + sizeof(data));
decoder.checked_read_u32v(decoder.start(), 0, &length); decoder.checked_read_u32v(decoder.start(), 0, &length);
EXPECT_EQ(5, length); EXPECT_EQ(5u, length);
EXPECT_FALSE(decoder.ok()); EXPECT_FALSE(decoder.ok());
} }
} }
...@@ -443,7 +443,7 @@ TEST_F(DecoderTest, ReadI32v_extra_bits_negative) { ...@@ -443,7 +443,7 @@ TEST_F(DecoderTest, ReadI32v_extra_bits_negative) {
byte data[] = {0xff, 0xff, 0xff, 0xff, 0x7f}; byte data[] = {0xff, 0xff, 0xff, 0xff, 0x7f};
decoder.Reset(data, data + sizeof(data)); decoder.Reset(data, data + sizeof(data));
decoder.checked_read_i32v(decoder.start(), 0, &length); decoder.checked_read_i32v(decoder.start(), 0, &length);
EXPECT_EQ(5, length); EXPECT_EQ(5u, length);
EXPECT_TRUE(decoder.ok()); EXPECT_TRUE(decoder.ok());
} }
...@@ -453,7 +453,7 @@ TEST_F(DecoderTest, ReadI32v_extra_bits_positive) { ...@@ -453,7 +453,7 @@ TEST_F(DecoderTest, ReadI32v_extra_bits_positive) {
byte data[] = {0x80, 0x80, 0x80, 0x80, 0x77}; byte data[] = {0x80, 0x80, 0x80, 0x80, 0x77};
decoder.Reset(data, data + sizeof(data)); decoder.Reset(data, data + sizeof(data));
decoder.checked_read_i32v(decoder.start(), 0, &length); decoder.checked_read_i32v(decoder.start(), 0, &length);
EXPECT_EQ(5, length); EXPECT_EQ(5u, length);
EXPECT_FALSE(decoder.ok()); EXPECT_FALSE(decoder.ok());
} }
...@@ -475,16 +475,16 @@ TEST_F(DecoderTest, ReadU32v_Bits) { ...@@ -475,16 +475,16 @@ TEST_F(DecoderTest, ReadU32v_Bits) {
uint32_t val = kVals[v]; uint32_t val = kVals[v];
if (i < 32) val &= ((1 << i) - 1); if (i < 32) val &= ((1 << i) - 1);
int length = 1 + i / 7; unsigned length = 1 + i / 7;
for (int j = 0; j < kMaxSize; j++) { for (unsigned j = 0; j < kMaxSize; j++) {
data[j] = static_cast<byte>((val >> (7 * j)) & MASK_7); data[j] = static_cast<byte>((val >> (7 * j)) & MASK_7);
} }
for (int j = 0; j < length - 1; j++) { for (unsigned j = 0; j < length - 1; j++) {
data[j] |= 0x80; data[j] |= 0x80;
} }
// foreach buffer size 0...5 // foreach buffer size 0...5
for (int limit = 0; limit <= kMaxSize; limit++) { for (unsigned limit = 0; limit <= kMaxSize; limit++) {
decoder.Reset(data, data + limit); decoder.Reset(data, data + limit);
unsigned rlen; unsigned rlen;
uint32_t result = decoder.checked_read_u32v(data, 0, &rlen); uint32_t result = decoder.checked_read_u32v(data, 0, &rlen);
...@@ -534,13 +534,13 @@ TEST_F(DecoderTest, ReadU64v_PowerOf2) { ...@@ -534,13 +534,13 @@ TEST_F(DecoderTest, ReadU64v_PowerOf2) {
const int kMaxSize = 10; const int kMaxSize = 10;
byte data[kMaxSize]; byte data[kMaxSize];
for (int i = 0; i < 64; i++) { for (unsigned i = 0; i < 64; i++) {
const uint64_t val = 1ull << i; const uint64_t val = 1ull << i;
int index = i / 7; unsigned index = i / 7;
data[index] = 1 << (i % 7); data[index] = 1 << (i % 7);
memset(data, 0x80, index); memset(data, 0x80, index);
for (int limit = 0; limit <= kMaxSize; limit++) { for (unsigned limit = 0; limit <= kMaxSize; limit++) {
decoder.Reset(data, data + limit); decoder.Reset(data, data + limit);
unsigned length; unsigned length;
uint64_t result = decoder.checked_read_u64v(data, 0, &length); uint64_t result = decoder.checked_read_u64v(data, 0, &length);
...@@ -572,16 +572,16 @@ TEST_F(DecoderTest, ReadU64v_Bits) { ...@@ -572,16 +572,16 @@ TEST_F(DecoderTest, ReadU64v_Bits) {
uint64_t val = kVals[v]; uint64_t val = kVals[v];
if (i < 64) val &= ((1ull << i) - 1); if (i < 64) val &= ((1ull << i) - 1);
int length = 1 + i / 7; unsigned length = 1 + i / 7;
for (int j = 0; j < kMaxSize; j++) { for (unsigned j = 0; j < kMaxSize; j++) {
data[j] = static_cast<byte>((val >> (7 * j)) & MASK_7); data[j] = static_cast<byte>((val >> (7 * j)) & MASK_7);
} }
for (int j = 0; j < length - 1; j++) { for (unsigned j = 0; j < length - 1; j++) {
data[j] |= 0x80; data[j] |= 0x80;
} }
// foreach buffer size 0...10 // foreach buffer size 0...10
for (int limit = 0; limit <= kMaxSize; limit++) { for (unsigned limit = 0; limit <= kMaxSize; limit++) {
decoder.Reset(data, data + limit); decoder.Reset(data, data + limit);
unsigned rlen; unsigned rlen;
uint64_t result = decoder.checked_read_u64v(data, 0, &rlen); uint64_t result = decoder.checked_read_u64v(data, 0, &rlen);
...@@ -614,16 +614,16 @@ TEST_F(DecoderTest, ReadI64v_Bits) { ...@@ -614,16 +614,16 @@ TEST_F(DecoderTest, ReadI64v_Bits) {
for (int i = 1; i <= 64; i++) { for (int i = 1; i <= 64; i++) {
const int64_t val = bit_cast<int64_t>(kVals[v] << (64 - i)) >> (64 - i); const int64_t val = bit_cast<int64_t>(kVals[v] << (64 - i)) >> (64 - i);
int length = 1 + i / 7; unsigned length = 1 + i / 7;
for (int j = 0; j < kMaxSize; j++) { for (unsigned j = 0; j < kMaxSize; j++) {
data[j] = static_cast<byte>((val >> (7 * j)) & MASK_7); data[j] = static_cast<byte>((val >> (7 * j)) & MASK_7);
} }
for (int j = 0; j < length - 1; j++) { for (unsigned j = 0; j < length - 1; j++) {
data[j] |= 0x80; data[j] |= 0x80;
} }
// foreach buffer size 0...10 // foreach buffer size 0...10
for (int limit = 0; limit <= kMaxSize; limit++) { for (unsigned limit = 0; limit <= kMaxSize; limit++) {
decoder.Reset(data, data + limit); decoder.Reset(data, data + limit);
unsigned rlen; unsigned rlen;
int64_t result = decoder.checked_read_i64v(data, 0, &rlen); int64_t result = decoder.checked_read_i64v(data, 0, &rlen);
...@@ -646,7 +646,7 @@ TEST_F(DecoderTest, ReadU64v_extra_bits) { ...@@ -646,7 +646,7 @@ TEST_F(DecoderTest, ReadU64v_extra_bits) {
unsigned length = 0; unsigned length = 0;
decoder.Reset(data, data + sizeof(data)); decoder.Reset(data, data + sizeof(data));
decoder.checked_read_u64v(decoder.start(), 0, &length); decoder.checked_read_u64v(decoder.start(), 0, &length);
EXPECT_EQ(10, length); EXPECT_EQ(10u, length);
EXPECT_FALSE(decoder.ok()); EXPECT_FALSE(decoder.ok());
} }
} }
...@@ -657,7 +657,7 @@ TEST_F(DecoderTest, ReadI64v_extra_bits_negative) { ...@@ -657,7 +657,7 @@ TEST_F(DecoderTest, ReadI64v_extra_bits_negative) {
byte data[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f}; byte data[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f};
decoder.Reset(data, data + sizeof(data)); decoder.Reset(data, data + sizeof(data));
decoder.checked_read_i64v(decoder.start(), 0, &length); decoder.checked_read_i64v(decoder.start(), 0, &length);
EXPECT_EQ(10, length); EXPECT_EQ(10u, length);
EXPECT_TRUE(decoder.ok()); EXPECT_TRUE(decoder.ok());
} }
...@@ -667,7 +667,7 @@ TEST_F(DecoderTest, ReadI64v_extra_bits_positive) { ...@@ -667,7 +667,7 @@ TEST_F(DecoderTest, ReadI64v_extra_bits_positive) {
byte data[] = {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x77}; byte data[] = {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x77};
decoder.Reset(data, data + sizeof(data)); decoder.Reset(data, data + sizeof(data));
decoder.checked_read_i64v(decoder.start(), 0, &length); decoder.checked_read_i64v(decoder.start(), 0, &length);
EXPECT_EQ(10, length); EXPECT_EQ(10u, length);
EXPECT_FALSE(decoder.ok()); EXPECT_FALSE(decoder.ok());
} }
......
...@@ -15,76 +15,76 @@ namespace wasm { ...@@ -15,76 +15,76 @@ namespace wasm {
class LEBHelperTest : public TestWithZone {}; class LEBHelperTest : public TestWithZone {};
TEST_F(LEBHelperTest, sizeof_u32v) { TEST_F(LEBHelperTest, sizeof_u32v) {
EXPECT_EQ(1, LEBHelper::sizeof_u32v(0)); EXPECT_EQ(1u, LEBHelper::sizeof_u32v(0));
EXPECT_EQ(1, LEBHelper::sizeof_u32v(1)); EXPECT_EQ(1u, LEBHelper::sizeof_u32v(1));
EXPECT_EQ(1, LEBHelper::sizeof_u32v(3)); EXPECT_EQ(1u, LEBHelper::sizeof_u32v(3));
for (uint32_t i = 4; i < 128; i++) { for (uint32_t i = 4; i < 128; i++) {
EXPECT_EQ(1, LEBHelper::sizeof_u32v(i)); EXPECT_EQ(1u, LEBHelper::sizeof_u32v(i));
} }
for (uint32_t i = (1u << 7); i < (1u << 9); i++) { for (uint32_t i = (1u << 7); i < (1u << 9); i++) {
EXPECT_EQ(2, LEBHelper::sizeof_u32v(i)); EXPECT_EQ(2u, LEBHelper::sizeof_u32v(i));
} }
for (uint32_t i = (1u << 14); i < (1u << 16); i += 33) { for (uint32_t i = (1u << 14); i < (1u << 16); i += 33) {
EXPECT_EQ(3, LEBHelper::sizeof_u32v(i)); EXPECT_EQ(3u, LEBHelper::sizeof_u32v(i));
} }
for (uint32_t i = (1u << 21); i < (1u << 24); i += 33999) { for (uint32_t i = (1u << 21); i < (1u << 24); i += 33999) {
EXPECT_EQ(4, LEBHelper::sizeof_u32v(i)); EXPECT_EQ(4u, LEBHelper::sizeof_u32v(i));
} }
for (uint32_t i = (1u << 28); i < (1u << 31); i += 33997779u) { for (uint32_t i = (1u << 28); i < (1u << 31); i += 33997779u) {
EXPECT_EQ(5, LEBHelper::sizeof_u32v(i)); EXPECT_EQ(5u, LEBHelper::sizeof_u32v(i));
} }
EXPECT_EQ(5, LEBHelper::sizeof_u32v(0xFFFFFFFF)); EXPECT_EQ(5u, LEBHelper::sizeof_u32v(0xFFFFFFFF));
} }
TEST_F(LEBHelperTest, sizeof_i32v) { TEST_F(LEBHelperTest, sizeof_i32v) {
EXPECT_EQ(1, LEBHelper::sizeof_i32v(0)); EXPECT_EQ(1u, LEBHelper::sizeof_i32v(0));
EXPECT_EQ(1, LEBHelper::sizeof_i32v(1)); EXPECT_EQ(1u, LEBHelper::sizeof_i32v(1));
EXPECT_EQ(1, LEBHelper::sizeof_i32v(3)); EXPECT_EQ(1u, LEBHelper::sizeof_i32v(3));
for (int32_t i = 0; i < (1 << 6); i++) { for (int32_t i = 0; i < (1 << 6); i++) {
EXPECT_EQ(1, LEBHelper::sizeof_i32v(i)); EXPECT_EQ(1u, LEBHelper::sizeof_i32v(i));
} }
for (int32_t i = (1 << 6); i < (1 << 8); i++) { for (int32_t i = (1 << 6); i < (1 << 8); i++) {
EXPECT_EQ(2, LEBHelper::sizeof_i32v(i)); EXPECT_EQ(2u, LEBHelper::sizeof_i32v(i));
} }
for (int32_t i = (1 << 13); i < (1 << 15); i += 31) { for (int32_t i = (1 << 13); i < (1 << 15); i += 31) {
EXPECT_EQ(3, LEBHelper::sizeof_i32v(i)); EXPECT_EQ(3u, LEBHelper::sizeof_i32v(i));
} }
for (int32_t i = (1 << 20); i < (1 << 22); i += 31991) { for (int32_t i = (1 << 20); i < (1 << 22); i += 31991) {
EXPECT_EQ(4, LEBHelper::sizeof_i32v(i)); EXPECT_EQ(4u, LEBHelper::sizeof_i32v(i));
} }
for (int32_t i = (1 << 27); i < (1 << 29); i += 3199893) { for (int32_t i = (1 << 27); i < (1 << 29); i += 3199893) {
EXPECT_EQ(5, LEBHelper::sizeof_i32v(i)); EXPECT_EQ(5u, LEBHelper::sizeof_i32v(i));
} }
for (int32_t i = -(1 << 6); i <= 0; i++) { for (int32_t i = -(1 << 6); i <= 0; i++) {
EXPECT_EQ(1, LEBHelper::sizeof_i32v(i)); EXPECT_EQ(1u, LEBHelper::sizeof_i32v(i));
} }
for (int32_t i = -(1 << 13); i < -(1 << 6); i++) { for (int32_t i = -(1 << 13); i < -(1 << 6); i++) {
EXPECT_EQ(2, LEBHelper::sizeof_i32v(i)); EXPECT_EQ(2u, LEBHelper::sizeof_i32v(i));
} }
for (int32_t i = -(1 << 20); i < -(1 << 18); i += 11) { for (int32_t i = -(1 << 20); i < -(1 << 18); i += 11) {
EXPECT_EQ(3, LEBHelper::sizeof_i32v(i)); EXPECT_EQ(3u, LEBHelper::sizeof_i32v(i));
} }
for (int32_t i = -(1 << 27); i < -(1 << 25); i += 11999) { for (int32_t i = -(1 << 27); i < -(1 << 25); i += 11999) {
EXPECT_EQ(4, LEBHelper::sizeof_i32v(i)); EXPECT_EQ(4u, LEBHelper::sizeof_i32v(i));
} }
for (int32_t i = -(1 << 30); i < -(1 << 28); i += 1199999) { for (int32_t i = -(1 << 30); i < -(1 << 28); i += 1199999) {
EXPECT_EQ(5, LEBHelper::sizeof_i32v(i)); EXPECT_EQ(5u, LEBHelper::sizeof_i32v(i));
} }
} }
......
...@@ -192,14 +192,14 @@ TEST_F(WasmModuleVerifyTest, OneGlobal) { ...@@ -192,14 +192,14 @@ TEST_F(WasmModuleVerifyTest, OneGlobal) {
// Should decode to exactly one global. // Should decode to exactly one global.
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
EXPECT_EQ(1, result.val->globals.size()); EXPECT_EQ(1u, result.val->globals.size());
EXPECT_EQ(0, result.val->functions.size()); EXPECT_EQ(0u, result.val->functions.size());
EXPECT_EQ(0, result.val->data_segments.size()); EXPECT_EQ(0u, result.val->data_segments.size());
const WasmGlobal* global = &result.val->globals.back(); const WasmGlobal* global = &result.val->globals.back();
EXPECT_EQ(kAstI32, global->type); EXPECT_EQ(kAstI32, global->type);
EXPECT_EQ(0, global->offset); EXPECT_EQ(0u, global->offset);
EXPECT_FALSE(global->mutability); EXPECT_FALSE(global->mutability);
EXPECT_EQ(WasmInitExpr::kI32Const, global->init.kind); EXPECT_EQ(WasmInitExpr::kI32Const, global->init.kind);
EXPECT_EQ(13, global->init.val.i32_const); EXPECT_EQ(13, global->init.val.i32_const);
...@@ -353,21 +353,21 @@ TEST_F(WasmModuleVerifyTest, TwoGlobals) { ...@@ -353,21 +353,21 @@ TEST_F(WasmModuleVerifyTest, TwoGlobals) {
// Should decode to exactly two globals. // Should decode to exactly two globals.
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
EXPECT_EQ(2, result.val->globals.size()); EXPECT_EQ(2u, result.val->globals.size());
EXPECT_EQ(0, result.val->functions.size()); EXPECT_EQ(0u, result.val->functions.size());
EXPECT_EQ(0, result.val->data_segments.size()); EXPECT_EQ(0u, result.val->data_segments.size());
const WasmGlobal* g0 = &result.val->globals[0]; const WasmGlobal* g0 = &result.val->globals[0];
EXPECT_EQ(kAstF32, g0->type); EXPECT_EQ(kAstF32, g0->type);
EXPECT_EQ(0, g0->offset); EXPECT_EQ(0u, g0->offset);
EXPECT_FALSE(g0->mutability); EXPECT_FALSE(g0->mutability);
EXPECT_EQ(WasmInitExpr::kF32Const, g0->init.kind); EXPECT_EQ(WasmInitExpr::kF32Const, g0->init.kind);
const WasmGlobal* g1 = &result.val->globals[1]; const WasmGlobal* g1 = &result.val->globals[1];
EXPECT_EQ(kAstF64, g1->type); EXPECT_EQ(kAstF64, g1->type);
EXPECT_EQ(8, g1->offset); EXPECT_EQ(8u, g1->offset);
EXPECT_TRUE(g1->mutability); EXPECT_TRUE(g1->mutability);
EXPECT_EQ(WasmInitExpr::kF64Const, g1->init.kind); EXPECT_EQ(WasmInitExpr::kF64Const, g1->init.kind);
...@@ -402,15 +402,15 @@ TEST_F(WasmModuleVerifyTest, MultipleSignatures) { ...@@ -402,15 +402,15 @@ TEST_F(WasmModuleVerifyTest, MultipleSignatures) {
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
EXPECT_EQ(3, result.val->signatures.size()); EXPECT_EQ(3u, result.val->signatures.size());
if (result.val->signatures.size() == 3) { if (result.val->signatures.size() == 3) {
EXPECT_EQ(0, result.val->signatures[0]->return_count()); EXPECT_EQ(0u, result.val->signatures[0]->return_count());
EXPECT_EQ(1, result.val->signatures[1]->return_count()); EXPECT_EQ(1u, result.val->signatures[1]->return_count());
EXPECT_EQ(1, result.val->signatures[2]->return_count()); EXPECT_EQ(1u, result.val->signatures[2]->return_count());
EXPECT_EQ(0, result.val->signatures[0]->parameter_count()); EXPECT_EQ(0u, result.val->signatures[0]->parameter_count());
EXPECT_EQ(1, result.val->signatures[1]->parameter_count()); EXPECT_EQ(1u, result.val->signatures[1]->parameter_count());
EXPECT_EQ(2, result.val->signatures[2]->parameter_count()); EXPECT_EQ(2u, result.val->signatures[2]->parameter_count());
} }
if (result.val) delete result.val; if (result.val) delete result.val;
...@@ -454,7 +454,7 @@ TEST_F(WasmModuleVerifyTest, DataSegmentWithImmutableImportedGlobal) { ...@@ -454,7 +454,7 @@ TEST_F(WasmModuleVerifyTest, DataSegmentWithImmutableImportedGlobal) {
EXPECT_OK(result); EXPECT_OK(result);
WasmInitExpr expr = result.val->data_segments.back().dest_addr; WasmInitExpr expr = result.val->data_segments.back().dest_addr;
EXPECT_EQ(WasmInitExpr::kGlobalIndex, expr.kind); EXPECT_EQ(WasmInitExpr::kGlobalIndex, expr.kind);
EXPECT_EQ(1, expr.val.global_index); EXPECT_EQ(1u, expr.val.global_index);
if (result.val) delete result.val; if (result.val) delete result.val;
} }
...@@ -533,16 +533,16 @@ TEST_F(WasmModuleVerifyTest, OneDataSegment) { ...@@ -533,16 +533,16 @@ TEST_F(WasmModuleVerifyTest, OneDataSegment) {
EXPECT_VERIFIES(data); EXPECT_VERIFIES(data);
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
EXPECT_EQ(0, result.val->globals.size()); EXPECT_EQ(0u, result.val->globals.size());
EXPECT_EQ(0, result.val->functions.size()); EXPECT_EQ(0u, result.val->functions.size());
EXPECT_EQ(1, result.val->data_segments.size()); EXPECT_EQ(1u, result.val->data_segments.size());
const WasmDataSegment* segment = &result.val->data_segments.back(); const WasmDataSegment* segment = &result.val->data_segments.back();
EXPECT_EQ(WasmInitExpr::kI32Const, segment->dest_addr.kind); EXPECT_EQ(WasmInitExpr::kI32Const, segment->dest_addr.kind);
EXPECT_EQ(0x9bbaa, segment->dest_addr.val.i32_const); EXPECT_EQ(0x9bbaa, segment->dest_addr.val.i32_const);
EXPECT_EQ(kDataSegmentSourceOffset, segment->source_offset); EXPECT_EQ(kDataSegmentSourceOffset, segment->source_offset);
EXPECT_EQ(3, segment->source_size); EXPECT_EQ(3u, segment->source_size);
if (result.val) delete result.val; if (result.val) delete result.val;
} }
...@@ -587,9 +587,9 @@ TEST_F(WasmModuleVerifyTest, TwoDataSegments) { ...@@ -587,9 +587,9 @@ TEST_F(WasmModuleVerifyTest, TwoDataSegments) {
{ {
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
EXPECT_EQ(0, result.val->globals.size()); EXPECT_EQ(0u, result.val->globals.size());
EXPECT_EQ(0, result.val->functions.size()); EXPECT_EQ(0u, result.val->functions.size());
EXPECT_EQ(2, result.val->data_segments.size()); EXPECT_EQ(2u, result.val->data_segments.size());
const WasmDataSegment* s0 = &result.val->data_segments[0]; const WasmDataSegment* s0 = &result.val->data_segments[0];
const WasmDataSegment* s1 = &result.val->data_segments[1]; const WasmDataSegment* s1 = &result.val->data_segments[1];
...@@ -597,12 +597,12 @@ TEST_F(WasmModuleVerifyTest, TwoDataSegments) { ...@@ -597,12 +597,12 @@ TEST_F(WasmModuleVerifyTest, TwoDataSegments) {
EXPECT_EQ(WasmInitExpr::kI32Const, s0->dest_addr.kind); EXPECT_EQ(WasmInitExpr::kI32Const, s0->dest_addr.kind);
EXPECT_EQ(0x7ffee, s0->dest_addr.val.i32_const); EXPECT_EQ(0x7ffee, s0->dest_addr.val.i32_const);
EXPECT_EQ(kDataSegment0SourceOffset, s0->source_offset); EXPECT_EQ(kDataSegment0SourceOffset, s0->source_offset);
EXPECT_EQ(4, s0->source_size); EXPECT_EQ(4u, s0->source_size);
EXPECT_EQ(WasmInitExpr::kI32Const, s1->dest_addr.kind); EXPECT_EQ(WasmInitExpr::kI32Const, s1->dest_addr.kind);
EXPECT_EQ(0x6ddcc, s1->dest_addr.val.i32_const); EXPECT_EQ(0x6ddcc, s1->dest_addr.val.i32_const);
EXPECT_EQ(kDataSegment1SourceOffset, s1->source_offset); EXPECT_EQ(kDataSegment1SourceOffset, s1->source_offset);
EXPECT_EQ(10, s1->source_size); EXPECT_EQ(10u, s1->source_size);
if (result.val) delete result.val; if (result.val) delete result.val;
} }
...@@ -673,10 +673,10 @@ TEST_F(WasmModuleVerifyTest, OneIndirectFunction) { ...@@ -673,10 +673,10 @@ TEST_F(WasmModuleVerifyTest, OneIndirectFunction) {
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
if (result.ok()) { if (result.ok()) {
EXPECT_EQ(1, result.val->signatures.size()); EXPECT_EQ(1u, result.val->signatures.size());
EXPECT_EQ(1, result.val->functions.size()); EXPECT_EQ(1u, result.val->functions.size());
EXPECT_EQ(1, result.val->function_tables.size()); EXPECT_EQ(1u, result.val->function_tables.size());
EXPECT_EQ(1, result.val->function_tables[0].min_size); EXPECT_EQ(1u, result.val->function_tables[0].min_size);
} }
if (result.val) delete result.val; if (result.val) delete result.val;
} }
...@@ -699,10 +699,10 @@ TEST_F(WasmModuleVerifyTest, OneIndirectFunction_one_entry) { ...@@ -699,10 +699,10 @@ TEST_F(WasmModuleVerifyTest, OneIndirectFunction_one_entry) {
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
if (result.ok()) { if (result.ok()) {
EXPECT_EQ(1, result.val->signatures.size()); EXPECT_EQ(1u, result.val->signatures.size());
EXPECT_EQ(1, result.val->functions.size()); EXPECT_EQ(1u, result.val->functions.size());
EXPECT_EQ(1, result.val->function_tables.size()); EXPECT_EQ(1u, result.val->function_tables.size());
EXPECT_EQ(1, result.val->function_tables[0].min_size); EXPECT_EQ(1u, result.val->function_tables[0].min_size);
} }
if (result.val) delete result.val; if (result.val) delete result.val;
} }
...@@ -736,10 +736,10 @@ TEST_F(WasmModuleVerifyTest, MultipleIndirectFunctions) { ...@@ -736,10 +736,10 @@ TEST_F(WasmModuleVerifyTest, MultipleIndirectFunctions) {
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
if (result.ok()) { if (result.ok()) {
EXPECT_EQ(2, result.val->signatures.size()); EXPECT_EQ(2u, result.val->signatures.size());
EXPECT_EQ(4, result.val->functions.size()); EXPECT_EQ(4u, result.val->functions.size());
EXPECT_EQ(1, result.val->function_tables.size()); EXPECT_EQ(1u, result.val->function_tables.size());
EXPECT_EQ(8, result.val->function_tables[0].min_size); EXPECT_EQ(8u, result.val->function_tables[0].min_size);
} }
if (result.val) delete result.val; if (result.val) delete result.val;
} }
...@@ -778,8 +778,8 @@ TEST_F(WasmSignatureDecodeTest, Ok_v_v) { ...@@ -778,8 +778,8 @@ TEST_F(WasmSignatureDecodeTest, Ok_v_v) {
DecodeWasmSignatureForTesting(&zone, data, data + sizeof(data)); DecodeWasmSignatureForTesting(&zone, data, data + sizeof(data));
EXPECT_TRUE(sig != nullptr); EXPECT_TRUE(sig != nullptr);
EXPECT_EQ(0, sig->parameter_count()); EXPECT_EQ(0u, sig->parameter_count());
EXPECT_EQ(0, sig->return_count()); EXPECT_EQ(0u, sig->return_count());
} }
TEST_F(WasmSignatureDecodeTest, Ok_t_v) { TEST_F(WasmSignatureDecodeTest, Ok_t_v) {
...@@ -790,8 +790,8 @@ TEST_F(WasmSignatureDecodeTest, Ok_t_v) { ...@@ -790,8 +790,8 @@ TEST_F(WasmSignatureDecodeTest, Ok_t_v) {
DecodeWasmSignatureForTesting(zone(), data, data + sizeof(data)); DecodeWasmSignatureForTesting(zone(), data, data + sizeof(data));
EXPECT_TRUE(sig != nullptr); EXPECT_TRUE(sig != nullptr);
EXPECT_EQ(0, sig->parameter_count()); EXPECT_EQ(0u, sig->parameter_count());
EXPECT_EQ(1, sig->return_count()); EXPECT_EQ(1u, sig->return_count());
EXPECT_EQ(ret_type.type, sig->GetReturn()); EXPECT_EQ(ret_type.type, sig->GetReturn());
} }
} }
...@@ -804,8 +804,8 @@ TEST_F(WasmSignatureDecodeTest, Ok_v_t) { ...@@ -804,8 +804,8 @@ TEST_F(WasmSignatureDecodeTest, Ok_v_t) {
DecodeWasmSignatureForTesting(zone(), data, data + sizeof(data)); DecodeWasmSignatureForTesting(zone(), data, data + sizeof(data));
EXPECT_TRUE(sig != nullptr); EXPECT_TRUE(sig != nullptr);
EXPECT_EQ(1, sig->parameter_count()); EXPECT_EQ(1u, sig->parameter_count());
EXPECT_EQ(0, sig->return_count()); EXPECT_EQ(0u, sig->return_count());
EXPECT_EQ(param_type.type, sig->GetParam(0)); EXPECT_EQ(param_type.type, sig->GetParam(0));
} }
} }
...@@ -820,8 +820,8 @@ TEST_F(WasmSignatureDecodeTest, Ok_t_t) { ...@@ -820,8 +820,8 @@ TEST_F(WasmSignatureDecodeTest, Ok_t_t) {
DecodeWasmSignatureForTesting(zone(), data, data + sizeof(data)); DecodeWasmSignatureForTesting(zone(), data, data + sizeof(data));
EXPECT_TRUE(sig != nullptr); EXPECT_TRUE(sig != nullptr);
EXPECT_EQ(1, sig->parameter_count()); EXPECT_EQ(1u, sig->parameter_count());
EXPECT_EQ(1, sig->return_count()); EXPECT_EQ(1u, sig->return_count());
EXPECT_EQ(param_type.type, sig->GetParam(0)); EXPECT_EQ(param_type.type, sig->GetParam(0));
EXPECT_EQ(ret_type.type, sig->GetReturn()); EXPECT_EQ(ret_type.type, sig->GetReturn());
} }
...@@ -839,8 +839,8 @@ TEST_F(WasmSignatureDecodeTest, Ok_i_tt) { ...@@ -839,8 +839,8 @@ TEST_F(WasmSignatureDecodeTest, Ok_i_tt) {
DecodeWasmSignatureForTesting(zone(), data, data + sizeof(data)); DecodeWasmSignatureForTesting(zone(), data, data + sizeof(data));
EXPECT_TRUE(sig != nullptr); EXPECT_TRUE(sig != nullptr);
EXPECT_EQ(2, sig->parameter_count()); EXPECT_EQ(2u, sig->parameter_count());
EXPECT_EQ(1, sig->return_count()); EXPECT_EQ(1u, sig->return_count());
EXPECT_EQ(p0_type.type, sig->GetParam(0)); EXPECT_EQ(p0_type.type, sig->GetParam(0));
EXPECT_EQ(p1_type.type, sig->GetParam(1)); EXPECT_EQ(p1_type.type, sig->GetParam(1));
} }
...@@ -916,10 +916,11 @@ TEST_F(WasmFunctionVerifyTest, Ok_v_v_empty) { ...@@ -916,10 +916,11 @@ TEST_F(WasmFunctionVerifyTest, Ok_v_v_empty) {
if (result.val && result.ok()) { if (result.val && result.ok()) {
WasmFunction* function = result.val; WasmFunction* function = result.val;
EXPECT_EQ(0, function->sig->parameter_count()); EXPECT_EQ(0u, function->sig->parameter_count());
EXPECT_EQ(0, function->sig->return_count()); EXPECT_EQ(0u, function->sig->return_count());
EXPECT_EQ(0, function->name_offset); EXPECT_EQ(0u, function->name_offset);
EXPECT_EQ(SIZEOF_SIG_ENTRY_v_v, function->code_start_offset); EXPECT_EQ(static_cast<uint32_t>(SIZEOF_SIG_ENTRY_v_v),
function->code_start_offset);
EXPECT_EQ(sizeof(data), function->code_end_offset); EXPECT_EQ(sizeof(data), function->code_end_offset);
// TODO(titzer): verify encoding of local declarations // TODO(titzer): verify encoding of local declarations
} }
...@@ -1021,14 +1022,14 @@ TEST_F(WasmModuleVerifyTest, UnknownSectionSkipped) { ...@@ -1021,14 +1022,14 @@ TEST_F(WasmModuleVerifyTest, UnknownSectionSkipped) {
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
EXPECT_EQ(1, result.val->globals.size()); EXPECT_EQ(1u, result.val->globals.size());
EXPECT_EQ(0, result.val->functions.size()); EXPECT_EQ(0u, result.val->functions.size());
EXPECT_EQ(0, result.val->data_segments.size()); EXPECT_EQ(0u, result.val->data_segments.size());
const WasmGlobal* global = &result.val->globals.back(); const WasmGlobal* global = &result.val->globals.back();
EXPECT_EQ(kAstI32, global->type); EXPECT_EQ(kAstI32, global->type);
EXPECT_EQ(0, global->offset); EXPECT_EQ(0u, global->offset);
if (result.val) delete result.val; if (result.val) delete result.val;
} }
...@@ -1155,8 +1156,8 @@ TEST_F(WasmModuleVerifyTest, ExportTable_empty1) { ...@@ -1155,8 +1156,8 @@ TEST_F(WasmModuleVerifyTest, ExportTable_empty1) {
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
EXPECT_EQ(1, result.val->functions.size()); EXPECT_EQ(1u, result.val->functions.size());
EXPECT_EQ(0, result.val->export_table.size()); EXPECT_EQ(0u, result.val->export_table.size());
if (result.val) delete result.val; if (result.val) delete result.val;
} }
...@@ -1186,8 +1187,8 @@ TEST_F(WasmModuleVerifyTest, ExportTableOne) { ...@@ -1186,8 +1187,8 @@ TEST_F(WasmModuleVerifyTest, ExportTableOne) {
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
EXPECT_EQ(1, result.val->functions.size()); EXPECT_EQ(1u, result.val->functions.size());
EXPECT_EQ(1, result.val->export_table.size()); EXPECT_EQ(1u, result.val->export_table.size());
if (result.val) delete result.val; if (result.val) delete result.val;
} }
...@@ -1230,8 +1231,8 @@ TEST_F(WasmModuleVerifyTest, ExportTableTwo) { ...@@ -1230,8 +1231,8 @@ TEST_F(WasmModuleVerifyTest, ExportTableTwo) {
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
EXPECT_EQ(1, result.val->functions.size()); EXPECT_EQ(1u, result.val->functions.size());
EXPECT_EQ(2, result.val->export_table.size()); EXPECT_EQ(2u, result.val->export_table.size());
if (result.val) delete result.val; if (result.val) delete result.val;
} }
...@@ -1258,8 +1259,8 @@ TEST_F(WasmModuleVerifyTest, ExportTableThree) { ...@@ -1258,8 +1259,8 @@ TEST_F(WasmModuleVerifyTest, ExportTableThree) {
ModuleResult result = DecodeModule(data, data + sizeof(data)); ModuleResult result = DecodeModule(data, data + sizeof(data));
EXPECT_OK(result); EXPECT_OK(result);
EXPECT_EQ(3, result.val->functions.size()); EXPECT_EQ(3u, result.val->functions.size());
EXPECT_EQ(3, result.val->export_table.size()); EXPECT_EQ(3u, result.val->export_table.size());
if (result.val) delete result.val; if (result.val) delete result.val;
} }
......
...@@ -12,10 +12,10 @@ namespace wasm { ...@@ -12,10 +12,10 @@ namespace wasm {
class WasmMacroGenTest : public TestWithZone {}; class WasmMacroGenTest : public TestWithZone {};
#define EXPECT_SIZE(size, ...) \ #define EXPECT_SIZE(size, ...) \
do { \ do { \
byte code[] = {__VA_ARGS__}; \ byte code[] = {__VA_ARGS__}; \
EXPECT_EQ(size, sizeof(code)); \ EXPECT_EQ(static_cast<size_t>(size), sizeof(code)); \
} while (false) } while (false)
TEST_F(WasmMacroGenTest, Constants) { TEST_F(WasmMacroGenTest, Constants) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment