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

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

Issue 1718083004: Allow constant multiply both ways. (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
« src/typing-asm.cc ('K') | « test/cctest/test-asm-validator.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 3f936f5f211db0fcc7a14d2b033a83f66969316a..841f68706d6f204d1965fae53b3b9c2c69f9d3de 100644
--- a/test/mjsunit/wasm/asm-wasm.js
+++ b/test/mjsunit/wasm/asm-wasm.js
@@ -1349,4 +1349,34 @@ TestForeignVariables();
var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString());
assertEquals(3, m.func());
-}) // TODO(bradnelson): Enable when Math.fround implementation lands.
+}); // TODO(bradnelson): Enable when Math.fround implementation lands.
+
+
+(function TestIntegerMultiplyBothWays() {
+ function Module(stdlib, foreign, heap) {
+ "use asm";
+ function func() {
+ var a = 1;
+ return ((a * 3) + (4 * a)) | 0;
+ }
+ return {func: func};
+ }
+
+ var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString());
+ assertEquals(7, m.func());
+})();
+
+
+(function TestBadMultiplyIntish() {
+ function Module(stdlib, foreign, heap) {
+ "use asm";
+ function func() {
+ var a = 1;
+ return ((a + a) * 4) | 0;
+ }
+ return {func: func};
+ }
+ assertThrows(function() {
+ _WASMEXP_.instantiateModuleFromAsm(Module.toString());
+ });
+})();
« src/typing-asm.cc ('K') | « test/cctest/test-asm-validator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698