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

Side by Side Diff: test/mjsunit/asm/uint32-less-than-shift.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/switch.js ('k') | test/mjsunit/asm/uint32div.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 function Module(stdlib, foreign, heap) { 5 function Module(stdlib, foreign, heap) {
6 'use asm'; 6 'use asm';
7 7
8 function foo1(i1) { 8 function foo1(i1) {
9 i1 = i1 | 0; 9 i1 = i1 | 0;
10 var i10 = i1 >> 5; 10 var i10 = 0;
11 i10 = (i1 >> 5) | 0;
11 if (i10 >>> 0 < 5) { 12 if (i10 >>> 0 < 5) {
12 return 1; 13 return 1;
13 } else { 14 } else {
14 return 0; 15 return 0;
15 } 16 }
16 return 0; 17 return 0;
17 } 18 }
18 19
19 function foo2(i1) { 20 function foo2(i1) {
20 i1 = i1 | 0; 21 i1 = i1 | 0;
21 var i10 = i1 / 32 | 0; 22 var i10 = 0;
23 i10 = ((i1 | 0) / 32) | 0;
22 if (i10 >>> 0 < 5) { 24 if (i10 >>> 0 < 5) {
23 return 1; 25 return 1;
24 } else { 26 } else {
25 return 0; 27 return 0;
26 } 28 }
27 return 0; 29 return 0;
28 } 30 }
29 31
30 function foo3(i1) { 32 function foo3(i1) {
31 i1 = i1 | 0; 33 i1 = i1 | 0;
32 var i10 = (i1 + 32 | 0) / 32 | 0; 34 var i10 = 0;
35 i10 = (i1 + 32 | 0) / 32 | 0;
33 if (i10 >>> 0 < 5) { 36 if (i10 >>> 0 < 5) {
34 return 1; 37 return 1;
35 } else { 38 } else {
36 return 0; 39 return 0;
37 } 40 }
38 return 0; 41 return 0;
39 } 42 }
40 return {foo1: foo1, foo2: foo2, foo3: foo3}; 43 return {foo1: foo1, foo2: foo2, foo3: foo3};
41 } 44 }
42 45
43 var m = Module(this, {}, undefined); 46 var m = Module(this, {}, undefined);
44 47
45 for (var i = 0; i < 4 * 32; i++) { 48 for (var i = 0; i < 4 * 32; i++) {
46 assertEquals(1, m.foo1(i)); 49 assertEquals(1, m.foo1(i));
47 assertEquals(1, m.foo2(i)); 50 assertEquals(1, m.foo2(i));
48 assertEquals(1, m.foo3(i)); 51 assertEquals(1, m.foo3(i));
49 } 52 }
50 53
51 for (var i = 4 * 32; i < 5 * 32; i++) { 54 for (var i = 4 * 32; i < 5 * 32; i++) {
52 assertEquals(1, m.foo1(i)); 55 assertEquals(1, m.foo1(i));
53 assertEquals(1, m.foo2(i)); 56 assertEquals(1, m.foo2(i));
54 assertEquals(0, m.foo3(i)); 57 assertEquals(0, m.foo3(i));
55 } 58 }
56 59
57 for (var i = 5 * 32; i < 10 * 32; i++) { 60 for (var i = 5 * 32; i < 10 * 32; i++) {
58 assertEquals(0, m.foo1(i)); 61 assertEquals(0, m.foo1(i));
59 assertEquals(0, m.foo2(i)); 62 assertEquals(0, m.foo2(i));
60 assertEquals(0, m.foo3(i)); 63 assertEquals(0, m.foo3(i));
61 } 64 }
OLDNEW
« no previous file with comments | « test/mjsunit/asm/switch.js ('k') | test/mjsunit/asm/uint32div.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698