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

Side by Side Diff: test/mjsunit/wasm/asm-wasm.js

Issue 2372823004: [wasm] asm.js: Work around parser converting !0 and !1 to boolean. (Closed)
Patch Set: Created 4 years, 2 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 | « src/asmjs/asm-wasm-builder.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: --validate-asm --allow-natives-syntax 5 // Flags: --validate-asm --allow-natives-syntax
6 6
7 var stdlib = this; 7 var stdlib = this;
8 8
9 function assertValidAsm(func) { 9 function assertValidAsm(func) {
10 assertTrue(%IsAsmWasmCode(func)); 10 assertTrue(%IsAsmWasmCode(func));
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 "use asm"; 1589 "use asm";
1590 function add(a, b) { 1590 function add(a, b) {
1591 a = a | 0; 1591 a = a | 0;
1592 b = b | 0; 1592 b = b | 0;
1593 return (a + b) | 0; 1593 return (a + b) | 0;
1594 } 1594 }
1595 return add; 1595 return add;
1596 } 1596 }
1597 1597
1598 assertEquals(7, TestSingleFunctionModule()(3, 4)); 1598 assertEquals(7, TestSingleFunctionModule()(3, 4));
1599
1600
1601 function TestNotZero() {
1602 "use asm";
1603 function caller() {
1604 if (!0) {
1605 return 44;
1606 } else {
1607 return 55;
1608 }
1609 return 0;
1610 }
1611 return {caller: caller};
1612 }
1613
1614 assertWasm(44, TestNotZero);
1615
1616
1617 function TestNotOne() {
1618 "use asm";
1619 function caller() {
1620 if (!1) {
1621 return 44;
1622 } else {
1623 return 55;
1624 }
1625 return 0;
1626 }
1627 return {caller: caller};
1628 }
1629
1630 assertWasm(55, TestNotOne);
OLDNEW
« no previous file with comments | « src/asmjs/asm-wasm-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698