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

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

Issue 1729263002: [wasm] I added comparison operators to the Int64Lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
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 2a1cfe2d9b33b11de1fba0805aa696248d2b2cef..cc6263a3684689b20798cd7324218293d58a7a75 100644
--- a/test/cctest/wasm/test-run-wasm-64.cc
+++ b/test/cctest/wasm/test-run-wasm-64.cc
@@ -56,14 +56,71 @@ TEST(Run_WasmI64Xor) {
// kExprI64Eq:
// kExprI64Ne:
// kExprI64LtS:
+TEST(Run_WasmI64LtS) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_LTS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_INT64_INPUTS(i) {
+ FOR_INT64_INPUTS(j) { CHECK_EQ(*i < *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
// kExprI64LeS:
+TEST(Run_WasmI64LeS) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_LES(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_INT64_INPUTS(i) {
+ FOR_INT64_INPUTS(j) { CHECK_EQ(*i <= *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
// kExprI64LtU:
+TEST(Run_WasmI64LtU) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_LTU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_UINT64_INPUTS(i) {
+ FOR_UINT64_INPUTS(j) { CHECK_EQ(*i < *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
// kExprI64LeU:
+TEST(Run_WasmI64LeU) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_LEU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_UINT64_INPUTS(i) {
+ FOR_UINT64_INPUTS(j) { CHECK_EQ(*i <= *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
// kExprI64GtS:
+TEST(Run_WasmI64GtS) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_GTS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_INT64_INPUTS(i) {
+ FOR_INT64_INPUTS(j) { CHECK_EQ(*i > *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
// kExprI64GeS:
+TEST(Run_WasmI64GeS) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_GES(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_INT64_INPUTS(i) {
+ FOR_INT64_INPUTS(j) { CHECK_EQ(*i >= *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
+
// kExprI64GtU:
-// kExprI64GeU:
+TEST(Run_WasmI64GtU) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_GTU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_UINT64_INPUTS(i) {
+ FOR_UINT64_INPUTS(j) { CHECK_EQ(*i > *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
+// kExprI64GeU:
+TEST(Run_WasmI64GeU) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_GEU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_UINT64_INPUTS(i) {
+ FOR_UINT64_INPUTS(j) { CHECK_EQ(*i >= *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
// kExprI32ConvertI64:
TEST(Run_WasmI32ConvertI64) {
FOR_INT64_INPUTS(i) {

Powered by Google App Engine
This is Rietveld 408576698