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

Unified Diff: test/mjsunit/wasm/asm-wasm.js

Issue 1583603002: Add __init__ function to all modules created in asm-to-wasm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@refactor
Patch Set: Created 4 years, 11 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 | « src/wasm/encoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/asm-wasm.js
diff --git a/test/mjsunit/wasm/asm-wasm.js b/test/mjsunit/wasm/asm-wasm.js
index ef5e0f566e82759ef2ae68210f977a31ece1d853..8dfe85aee1a92427926dcda0558d6a010a05ad94 100644
--- a/test/mjsunit/wasm/asm-wasm.js
+++ b/test/mjsunit/wasm/asm-wasm.js
@@ -757,3 +757,29 @@ function TestNestedSwitch() {
}
assertEquals(43, _WASMEXP_.asmCompileRun(TestNestedSwitch.toString()));
+
+function TestInitFunctionWithNoGlobals() {
+ "use asm";
+ function caller() {
+ return 51;
+ }
+ return {caller};
+}
+
+var module = _WASMEXP_.instantiateModuleFromAsm(
+ TestInitFunctionWithNoGlobals.toString());
+module.__init__();
+assertEquals(51, module.caller());
+
+function TestExportNameDifferentFromFunctionName() {
+ "use asm";
+ function caller() {
+ return 55;
+ }
+ return {alt_caller:caller};
+}
+
+var module = _WASMEXP_.instantiateModuleFromAsm(
+ TestExportNameDifferentFromFunctionName.toString());
+module.__init__();
+assertEquals(55, module.alt_caller());
« no previous file with comments | « src/wasm/encoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698