OLD | NEW |
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 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 var y = 2.0; | 1516 var y = 2.0; |
1517 return (x & y) | 0; | 1517 return (x & y) | 0; |
1518 } | 1518 } |
1519 return {func: func}; | 1519 return {func: func}; |
1520 } | 1520 } |
1521 | 1521 |
1522 assertThrows(function() { | 1522 assertThrows(function() { |
1523 _WASMEXP_.instantiateModuleFromAsm(Module.toString()); | 1523 _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
1524 }); | 1524 }); |
1525 })(); | 1525 })(); |
| 1526 |
| 1527 |
| 1528 (function TestAndIntAndHeapValue() { |
| 1529 function Module(stdlib, foreign, buffer) { |
| 1530 "use asm"; |
| 1531 var HEAP32 = new stdlib.Int32Array(buffer); |
| 1532 function func() { |
| 1533 var x = 0; |
| 1534 x = HEAP32[0] & -1; |
| 1535 return x | 0; |
| 1536 } |
| 1537 return {func: func}; |
| 1538 } |
| 1539 |
| 1540 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
| 1541 assertEquals(0, m.func()); |
| 1542 })(); |
OLD | NEW |