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

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: fi 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/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 c4d65915274c34115aab194be03d4764886460dd..165a55a8fa7b579c4638e943b2e15a790c831cb8 100644
--- a/test/mjsunit/wasm/asm-wasm.js
+++ b/test/mjsunit/wasm/asm-wasm.js
@@ -1441,4 +1441,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());
+ });
+})();
« no previous file with comments | « test/cctest/test-asm-validator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698