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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-asm-validator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --expose-wasm 5 // Flags: --expose-wasm
6 6
7 function EmptyTest() { 7 function EmptyTest() {
8 "use asm"; 8 "use asm";
9 function caller() { 9 function caller() {
10 empty(); 10 empty();
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 var a = fround(1.0); 1434 var a = fround(1.0);
1435 var b = fround(2.0); 1435 var b = fround(2.0);
1436 HEAPF32[0] = a + b; 1436 HEAPF32[0] = a + b;
1437 return +HEAPF32[0]; 1437 return +HEAPF32[0];
1438 } 1438 }
1439 return {func: func}; 1439 return {func: func};
1440 } 1440 }
1441 1441
1442 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); 1442 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString());
1443 assertEquals(3, m.func()); 1443 assertEquals(3, m.func());
1444 }) // TODO(bradnelson): Enable when Math.fround implementation lands. 1444 }); // TODO(bradnelson): Enable when Math.fround implementation lands.
1445
1446
1447 (function TestIntegerMultiplyBothWays() {
1448 function Module(stdlib, foreign, heap) {
1449 "use asm";
1450 function func() {
1451 var a = 1;
1452 return ((a * 3) + (4 * a)) | 0;
1453 }
1454 return {func: func};
1455 }
1456
1457 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString());
1458 assertEquals(7, m.func());
1459 })();
1460
1461
1462 (function TestBadMultiplyIntish() {
1463 function Module(stdlib, foreign, heap) {
1464 "use asm";
1465 function func() {
1466 var a = 1;
1467 return ((a + a) * 4) | 0;
1468 }
1469 return {func: func};
1470 }
1471 assertThrows(function() {
1472 _WASMEXP_.instantiateModuleFromAsm(Module.toString());
1473 });
1474 })();
OLDNEW
« 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