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 load("test/mjsunit/wasm/wasm-constants.js"); | 7 load("test/mjsunit/wasm/wasm-constants.js"); |
8 | 8 |
9 try { | 9 try { |
10 var data = bytes( | 10 var data = bytes( |
11 0, kAstStmt, // signature | 11 kWasmFunctionTypeForm, 0, kAstStmt, // signature |
12 kDeclNoLocals, // -- | 12 kDeclNoLocals, // -- |
13 kExprNop // body | 13 kExprNop // body |
14 ); | 14 ); |
15 | 15 |
16 Wasm.verifyFunction(data); | 16 Wasm.verifyFunction(data); |
17 print("ok"); | 17 print("ok"); |
18 } catch (e) { | 18 } catch (e) { |
19 assertTrue(false); | 19 assertTrue(false); |
20 } | 20 } |
21 | 21 |
22 | 22 |
23 var threw = false; | 23 var threw = false; |
24 try { | 24 try { |
25 var data = bytes( | 25 var data = bytes( |
26 0, kAstI32, // signature | 26 kWasmFunctionTypeForm, 0, 1, kAstI32, // signature |
27 kDeclNoLocals, // -- | 27 kDeclNoLocals, // -- |
28 kExprBlock, kExprNop, kExprNop, kExprEnd // body | 28 kExprBlock, kExprNop, kExprNop, kExprEnd // body |
29 ); | 29 ); |
30 | 30 |
31 Wasm.verifyFunction(data); | 31 Wasm.verifyFunction(data); |
32 print("not ok"); | 32 print("not ok"); |
33 } catch (e) { | 33 } catch (e) { |
34 print("ok: " + e); | 34 print("ok: " + e); |
35 threw = true; | 35 threw = true; |
36 } | 36 } |
37 | 37 |
38 assertTrue(threw); | 38 assertTrue(threw); |
OLD | NEW |