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

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

Issue 1702023002: [wasm] Replace the BufferedRawMachineAssemblerTester in the WasmRunner. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Code cleanup. 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
« no previous file with comments | « test/cctest/compiler/value-helper.h ('k') | test/cctest/wasm/test-run-wasm-js.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.cc
diff --git a/test/cctest/wasm/test-run-wasm.cc b/test/cctest/wasm/test-run-wasm.cc
index a3730cae0a521787be579c2f8073676b79b2ca16..e4f20dd8fc70d7ef861aacba82b2305414e57c61 100644
--- a/test/cctest/wasm/test-run-wasm.cc
+++ b/test/cctest/wasm/test-run-wasm.cc
@@ -1276,16 +1276,43 @@ TEST(Run_Wasm_ReturnStore) {
TEST(Run_Wasm_VoidReturn1) {
- WasmRunner<void> r;
- BUILD(r, kExprNop);
- r.Call();
+ // We use a wrapper function because WasmRunner<void> does not exist.
+
+ // Build the test function.
+ TestSignatures sigs;
+ TestingModule module;
+ WasmFunctionCompiler t(sigs.v_v());
+ BUILD(t, kExprNop);
+ uint32_t index = t.CompileAndAdd(&module);
+
+ const int32_t kExpected = -414444;
+ // Build the calling function.
+ WasmRunner<int32_t> r;
+ r.env()->module = &module;
+ BUILD(r, WASM_BLOCK(2, WASM_CALL_FUNCTION0(index), WASM_I32(kExpected)));
+
+ int32_t result = r.Call();
+ CHECK_EQ(kExpected, result);
}
TEST(Run_Wasm_VoidReturn2) {
- WasmRunner<void> r;
- BUILD(r, WASM_RETURN0);
- r.Call();
+ // We use a wrapper function because WasmRunner<void> does not exist.
+ // Build the test function.
+ TestSignatures sigs;
+ TestingModule module;
+ WasmFunctionCompiler t(sigs.v_v());
+ BUILD(t, WASM_RETURN0);
+ uint32_t index = t.CompileAndAdd(&module);
+
+ const int32_t kExpected = -414444;
+ // Build the calling function.
+ WasmRunner<int32_t> r;
+ r.env()->module = &module;
+ BUILD(r, WASM_BLOCK(2, WASM_CALL_FUNCTION0(index), WASM_I32(kExpected)));
+
+ int32_t result = r.Call();
+ CHECK_EQ(kExpected, result);
}
« no previous file with comments | « test/cctest/compiler/value-helper.h ('k') | test/cctest/wasm/test-run-wasm-js.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698