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 assertWasm(expected, func, ffi) { | 7 function assertWasm(expected, func, ffi) { |
8 print("Testing " + func.name + "..."); | 8 print("Testing " + func.name + "..."); |
9 assertEquals(expected, Wasm.instantiateModuleFromAsm( | 9 assertEquals(expected, Wasm.instantiateModuleFromAsm( |
10 func.toString(), ffi).caller()); | 10 func.toString(), ffi).caller()); |
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 u0xffffffff: u0xffffffff, | 1523 u0xffffffff: u0xffffffff, |
1524 u0x80000000: u0x80000000, | 1524 u0x80000000: u0x80000000, |
1525 u0x87654321: u0x87654321, | 1525 u0x87654321: u0x87654321, |
1526 }; | 1526 }; |
1527 } | 1527 } |
1528 var wasm = Wasm.instantiateModuleFromAsm(asmModule.toString()); | 1528 var wasm = Wasm.instantiateModuleFromAsm(asmModule.toString()); |
1529 assertEquals(0xffffffff, wasm.u0xffffffff()); | 1529 assertEquals(0xffffffff, wasm.u0xffffffff()); |
1530 assertEquals(0x80000000, wasm.u0x80000000()); | 1530 assertEquals(0x80000000, wasm.u0x80000000()); |
1531 assertEquals(0x87654321, wasm.u0x87654321()); | 1531 assertEquals(0x87654321, wasm.u0x87654321()); |
1532 })(); | 1532 })(); |
| 1533 |
| 1534 (function TestBadNoDeclaration() { |
| 1535 assertThrows(function() { |
| 1536 Wasm.instantiateModuleFromAsm('33;'); |
| 1537 }); |
| 1538 })(); |
| 1539 |
| 1540 (function TestBadVarDeclaration() { |
| 1541 assertThrows(function() { |
| 1542 Wasm.instantiateModuleFromAsm('var x = 3;'); |
| 1543 }); |
| 1544 })(); |
OLD | NEW |