OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 the V8 project authors. All rights reserved. | |
titzer
2017/01/26 10:48:07
Hmm, I don't think we should necessarily have a WA
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 load("test/mjsunit/wasm/wasm-constants.js"); | |
6 load("test/mjsunit/wasm/wasm-module-builder.js"); | |
7 | |
8 (function() { | |
9 var builder = new WasmModuleBuilder(); | |
10 builder.addMemory(16, 32, false); | |
11 builder.addFunction("test", kSig_i_iii) | |
12 .addBodyWithEnd([ | |
13 // body: | |
14 kExprGetLocal, 0x00, | |
15 kExprGrowMemory, 0x00, | |
16 kExprGetLocal, 0x00, | |
17 kExprGrowMemory, 0x00, | |
18 kExprGetLocal, 0x01, | |
19 kExprGrowMemory, 0x00, | |
20 kExprGetLocal, 0x01, | |
21 kExprGrowMemory, 0x00, | |
22 kExprGetLocal, 0x00, | |
23 kExprGrowMemory, 0x00, | |
24 kExprGetLocal, 0x01, | |
25 kExprGrowMemory, 0x00, | |
26 kExprGetLocal, 0x01, | |
27 kExprGrowMemory, 0x00, | |
28 kExprGetLocal, 0x00, | |
29 kExprGrowMemory, 0x00, | |
30 kExprGetLocal, 0x00, | |
31 kExprGrowMemory, 0x00, | |
32 kExprGetLocal, 0x01, | |
33 kExprGrowMemory, 0x00, | |
34 kExprI32StoreMem16, 0x00, 0xff, 0xff, 0x3f, | |
35 kExprUnreachable, | |
36 kExprEnd, // @90 | |
37 ]) | |
38 .exportFunc(); | |
39 var module = builder.instantiate(); | |
40 assertTraps(kTrapUnreachable, () => {module.exports.test(1, 2, 3)}); | |
41 })(); | |
OLD | NEW |