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 // Flags: --wasm-jit-prototpe | |
bradn
2016/06/16 08:00:20
probably a separate file here too
| |
6 | 7 |
7 load("test/mjsunit/wasm/wasm-constants.js"); | 8 load("test/mjsunit/wasm/wasm-constants.js"); |
8 load("test/mjsunit/wasm/wasm-module-builder.js"); | 9 load("test/mjsunit/wasm/wasm-module-builder.js"); |
9 | 10 |
10 var module = (function () { | 11 var module = (function () { |
11 var builder = new WasmModuleBuilder(); | 12 var builder = new WasmModuleBuilder(); |
12 | 13 |
13 var sig_index = builder.addSignature(kSig_i_ii); | 14 var sig_index = builder.addSignature(kSig_i_ii); |
14 builder.addImport("add", sig_index); | 15 builder.addImport("add", sig_index); |
15 builder.addFunction("add", sig_index) | 16 builder.addFunction("add", sig_index) |
(...skipping 24 matching lines...) Expand all Loading... | |
40 assertFalse(module === null); | 41 assertFalse(module === null); |
41 assertFalse(module === 0); | 42 assertFalse(module === 0); |
42 assertEquals("object", typeof module.exports); | 43 assertEquals("object", typeof module.exports); |
43 assertEquals("function", typeof module.exports.main); | 44 assertEquals("function", typeof module.exports.main); |
44 | 45 |
45 assertEquals(5, module.exports.main(1, 12, 7)); | 46 assertEquals(5, module.exports.main(1, 12, 7)); |
46 assertEquals(19, module.exports.main(0, 12, 7)); | 47 assertEquals(19, module.exports.main(0, 12, 7)); |
47 | 48 |
48 assertTraps(kTrapFuncSigMismatch, "module.exports.main(2, 12, 33)"); | 49 assertTraps(kTrapFuncSigMismatch, "module.exports.main(2, 12, 33)"); |
49 assertTraps(kTrapFuncInvalid, "module.exports.main(3, 12, 33)"); | 50 assertTraps(kTrapFuncInvalid, "module.exports.main(3, 12, 33)"); |
OLD | NEW |