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

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

Issue 1704553002: Implementing comma operator for asm->wasm. (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
« no previous file with comments | « src/wasm/asm-wasm-builder.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 100da9d065bfa3ea7446ef3d25ea0b293a2591cc..6abf59c583541f028f17de022838d986d200b1f9 100644
--- a/test/mjsunit/wasm/asm-wasm.js
+++ b/test/mjsunit/wasm/asm-wasm.js
@@ -1042,6 +1042,7 @@ function TestForeignFunctions() {
TestForeignFunctions();
+
function TestForeignFunctionMultipleUse() {
function AsmModule(stdlib, foreign, buffer) {
"use asm";
@@ -1219,3 +1220,28 @@ TestForeignVariables();
assertEquals(42, m.iload(4));
assertEquals(77, m.iload(8));
})();
+
+
+(function TestComma() {
+ function CommaModule() {
+ "use asm";
+
+ function ifunc(a, b) {
+ a = +a;
+ b = b | 0;
+ return (a, b) | 0;
+ }
+
+ function dfunc(a, b) {
+ a = a | 0;
+ b = +b;
+ return +(a, b);
+ }
+
+ return {ifunc: ifunc, dfunc: dfunc};
+ }
+
+ var m = _WASMEXP_.instantiateModuleFromAsm(CommaModule.toString());
+ assertEquals(123, m.ifunc(456.7, 123));
+ assertEquals(123.4, m.dfunc(456, 123.4));
+})();
« no previous file with comments | « src/wasm/asm-wasm-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698