OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 function Module(stdlib, foreign, heap) { |
| 6 'use asm'; |
| 7 |
| 8 function foo1(i1) { |
| 9 i1 = i1 | 0; |
| 10 var i10 = i1 >> 5; |
| 11 if (i10 >>> 0 < 5) { |
| 12 return 1; |
| 13 } else { |
| 14 return 0; |
| 15 } |
| 16 return 0; |
| 17 } |
| 18 |
| 19 function foo2(i1) { |
| 20 i1 = i1 | 0; |
| 21 var i10 = i1 / 32 | 0; |
| 22 if (i10 >>> 0 < 5) { |
| 23 return 1; |
| 24 } else { |
| 25 return 0; |
| 26 } |
| 27 return 0; |
| 28 } |
| 29 |
| 30 function foo3(i1) { |
| 31 i1 = i1 | 0; |
| 32 var i10 = (i1 + 32 | 0) / 32 | 0; |
| 33 if (i10 >>> 0 < 5) { |
| 34 return 1; |
| 35 } else { |
| 36 return 0; |
| 37 } |
| 38 return 0; |
| 39 } |
| 40 return {foo1: foo1, foo2: foo2, foo3: foo3}; |
| 41 } |
| 42 |
| 43 var m = Module(this, {}, undefined); |
| 44 |
| 45 for (var i = 0; i < 4 * 32; i++) { |
| 46 assertEquals(1, m.foo1(i)); |
| 47 assertEquals(1, m.foo2(i)); |
| 48 assertEquals(1, m.foo3(i)); |
| 49 } |
| 50 |
| 51 for (var i = 4 * 32; i < 5 * 32; i++) { |
| 52 assertEquals(1, m.foo1(i)); |
| 53 assertEquals(1, m.foo2(i)); |
| 54 assertEquals(0, m.foo3(i)); |
| 55 } |
| 56 |
| 57 for (var i = 5 * 32; i < 10 * 32; i++) { |
| 58 assertEquals(0, m.foo1(i)); |
| 59 assertEquals(0, m.foo2(i)); |
| 60 assertEquals(0, m.foo3(i)); |
| 61 } |
OLD | NEW |