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

Unified Diff: test/cctest/wasm/test-run-wasm-64.cc

Issue 2487673004: [wasm] Fix -Wsign-compare warnings. (Closed)
Patch Set: address comments Created 4 years, 1 month 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/cctest/wasm/test-run-wasm.cc ('k') | test/cctest/wasm/test-run-wasm-interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm-64.cc
diff --git a/test/cctest/wasm/test-run-wasm-64.cc b/test/cctest/wasm/test-run-wasm-64.cc
index 63a260b9c0daef0053948da133053a250b921e8e..36558b0c93fbcfc4d2267f0db78388243bc09085 100644
--- a/test/cctest/wasm/test-run-wasm-64.cc
+++ b/test/cctest/wasm/test-run-wasm-64.cc
@@ -198,7 +198,7 @@ WASM_EXEC_TEST(I64ShlUseOnlyLowWord) {
WASM_I64_SHL(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))));
FOR_INT64_INPUTS(i) {
FOR_INT64_INPUTS(j) {
- uint64_t expected = static_cast<int32_t>((*i) << (*j & 0x3f));
+ int32_t expected = static_cast<int32_t>((*i) << (*j & 0x3f));
CHECK_EQ(expected, r.Call(*i, *j));
}
}
@@ -213,7 +213,7 @@ WASM_EXEC_TEST(I64ShrUseOnlyLowWord) {
WASM_I64_SHR(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))));
FOR_UINT64_INPUTS(i) {
FOR_UINT64_INPUTS(j) {
- uint64_t expected = static_cast<int32_t>((*i) >> (*j & 0x3f));
+ int32_t expected = static_cast<int32_t>((*i) >> (*j & 0x3f));
CHECK_EQ(expected, r.Call(*i, *j));
}
}
@@ -228,7 +228,7 @@ WASM_EXEC_TEST(I64SarUseOnlyLowWord) {
WASM_I64_SAR(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))));
FOR_INT64_INPUTS(i) {
FOR_INT64_INPUTS(j) {
- uint64_t expected = static_cast<int32_t>((*i) >> (*j & 0x3f));
+ int32_t expected = static_cast<int32_t>((*i) >> (*j & 0x3f));
CHECK_EQ(expected, r.Call(*i, *j));
}
}
@@ -422,22 +422,22 @@ WASM_EXEC_TEST(I64Shl) {
}
}
{
- WasmRunner<int64_t> r(execution_mode, MachineType::Int64());
+ WasmRunner<uint64_t> r(execution_mode, MachineType::Int64());
BUILD(r, WASM_I64_SHL(WASM_GET_LOCAL(0), WASM_I64V_1(0)));
FOR_UINT64_INPUTS(i) { CHECK_EQ(*i << 0, r.Call(*i)); }
}
{
- WasmRunner<int64_t> r(execution_mode, MachineType::Int64());
+ WasmRunner<uint64_t> r(execution_mode, MachineType::Int64());
BUILD(r, WASM_I64_SHL(WASM_GET_LOCAL(0), WASM_I64V_1(32)));
FOR_UINT64_INPUTS(i) { CHECK_EQ(*i << 32, r.Call(*i)); }
}
{
- WasmRunner<int64_t> r(execution_mode, MachineType::Int64());
+ WasmRunner<uint64_t> r(execution_mode, MachineType::Int64());
BUILD(r, WASM_I64_SHL(WASM_GET_LOCAL(0), WASM_I64V_1(20)));
FOR_UINT64_INPUTS(i) { CHECK_EQ(*i << 20, r.Call(*i)); }
}
{
- WasmRunner<int64_t> r(execution_mode, MachineType::Int64());
+ WasmRunner<uint64_t> r(execution_mode, MachineType::Int64());
BUILD(r, WASM_I64_SHL(WASM_GET_LOCAL(0), WASM_I64V_1(40)));
FOR_UINT64_INPUTS(i) { CHECK_EQ(*i << 40, r.Call(*i)); }
}
@@ -458,22 +458,22 @@ WASM_EXEC_TEST(I64ShrU) {
}
}
{
- WasmRunner<int64_t> r(execution_mode, MachineType::Int64());
+ WasmRunner<uint64_t> r(execution_mode, MachineType::Int64());
BUILD(r, WASM_I64_SHR(WASM_GET_LOCAL(0), WASM_I64V_1(0)));
FOR_UINT64_INPUTS(i) { CHECK_EQ(*i >> 0, r.Call(*i)); }
}
{
- WasmRunner<int64_t> r(execution_mode, MachineType::Int64());
+ WasmRunner<uint64_t> r(execution_mode, MachineType::Int64());
BUILD(r, WASM_I64_SHR(WASM_GET_LOCAL(0), WASM_I64V_1(32)));
FOR_UINT64_INPUTS(i) { CHECK_EQ(*i >> 32, r.Call(*i)); }
}
{
- WasmRunner<int64_t> r(execution_mode, MachineType::Int64());
+ WasmRunner<uint64_t> r(execution_mode, MachineType::Int64());
BUILD(r, WASM_I64_SHR(WASM_GET_LOCAL(0), WASM_I64V_1(20)));
FOR_UINT64_INPUTS(i) { CHECK_EQ(*i >> 20, r.Call(*i)); }
}
{
- WasmRunner<int64_t> r(execution_mode, MachineType::Int64());
+ WasmRunner<uint64_t> r(execution_mode, MachineType::Int64());
BUILD(r, WASM_I64_SHR(WASM_GET_LOCAL(0), WASM_I64V_1(40)));
FOR_UINT64_INPUTS(i) { CHECK_EQ(*i >> 40, r.Call(*i)); }
}
@@ -635,7 +635,7 @@ WASM_EXEC_TEST(I64UConvertI32) {
REQUIRE(I64UConvertI32);
WasmRunner<int64_t> r(execution_mode, MachineType::Uint32());
BUILD(r, WASM_I64_UCONVERT_I32(WASM_GET_LOCAL(0)));
- FOR_UINT32_INPUTS(i) { CHECK_EQ(static_cast<uint64_t>(*i), r.Call(*i)); }
+ FOR_UINT32_INPUTS(i) { CHECK_EQ(static_cast<int64_t>(*i), r.Call(*i)); }
}
WASM_EXEC_TEST(I64Popcnt) {
@@ -1366,8 +1366,8 @@ WASM_EXEC_TEST(LoadMemI64) {
BUILD(r, WASM_LOAD_MEM(MachineType::Int64(), WASM_I8(0)));
- module.WriteMemory<int64_t>(&memory[0], 0xaabbccdd00112233LL);
- CHECK_EQ(0xaabbccdd00112233LL, r.Call());
+ module.WriteMemory<int64_t>(&memory[0], 0x1abbccdd00112233LL);
+ CHECK_EQ(0x1abbccdd00112233LL, r.Call());
module.WriteMemory<int64_t>(&memory[0], 0x33aabbccdd001122LL);
CHECK_EQ(0x33aabbccdd001122LL, r.Call());
@@ -1387,8 +1387,8 @@ WASM_EXEC_TEST(LoadMemI64_alignment) {
BUILD(r,
WASM_LOAD_MEM_ALIGNMENT(MachineType::Int64(), WASM_I8(0), alignment));
- module.WriteMemory<int64_t>(&memory[0], 0xaabbccdd00112233LL);
- CHECK_EQ(0xaabbccdd00112233LL, r.Call());
+ module.WriteMemory<int64_t>(&memory[0], 0x1abbccdd00112233LL);
+ CHECK_EQ(0x1abbccdd00112233LL, r.Call());
module.WriteMemory<int64_t>(&memory[0], 0x33aabbccdd001122LL);
CHECK_EQ(0x33aabbccdd001122LL, r.Call());
« no previous file with comments | « test/cctest/wasm/test-run-wasm.cc ('k') | test/cctest/wasm/test-run-wasm-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698