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

Side by Side Diff: test/mjsunit/asm/if-cloning.js

Issue 2663243002: [asm] Fix lots of invalid asm.js tests (Closed)
Patch Set: Rebase Created 3 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/mjsunit/asm/float64mul.js ('k') | test/mjsunit/asm/if-folding.js » ('j') | 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 var if0 = (function Module() { 5 var if0 = (function Module() {
6 "use asm"; 6 "use asm";
7 function if0(i, j) { 7 function if0(i, j) {
8 i = i|0; 8 i = i|0;
9 j = j|0; 9 j = j|0;
10 if (i == 0 ? j == 0 : 0) return 1; 10 if ((i | 0) == 0 ? (j | 0) == 0 : 0) return 1;
11 return 0; 11 return 0;
12 } 12 }
13 return {if0: if0}; 13 return {if0: if0};
14 })().if0; 14 })().if0;
15 assertEquals(1, if0(0, 0)); 15 assertEquals(1, if0(0, 0));
16 assertEquals(0, if0(11, 0)); 16 assertEquals(0, if0(11, 0));
17 assertEquals(0, if0(0, -1)); 17 assertEquals(0, if0(0, -1));
18 assertEquals(0, if0(-1024, 1)); 18 assertEquals(0, if0(-1024, 1));
19 19
20 20
21 var if1 = (function Module() { 21 var if1 = (function Module() {
22 "use asm"; 22 "use asm";
23 function if1(i, j) { 23 function if1(i, j) {
24 i = i|0; 24 i = i|0;
25 j = j|0; 25 j = j|0;
26 if (i == 0 ? j == 0 : 1) return 0; 26 if ((i | 0) == 0 ? (j | 0) == 0 : 1) return 0;
27 return 1; 27 return 1;
28 } 28 }
29 return {if1: if1}; 29 return {if1: if1};
30 })().if1; 30 })().if1;
31 assertEquals(0, if1(0, 0)); 31 assertEquals(0, if1(0, 0));
32 assertEquals(0, if1(11, 0)); 32 assertEquals(0, if1(11, 0));
33 assertEquals(1, if1(0, -1)); 33 assertEquals(1, if1(0, -1));
34 assertEquals(0, if1(-1024, 9)); 34 assertEquals(0, if1(-1024, 9));
OLDNEW
« no previous file with comments | « test/mjsunit/asm/float64mul.js ('k') | test/mjsunit/asm/if-folding.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698