blob: 31c23a6b692c2e90d53adf29530ca47c59d315fb [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// 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
3// found in the LICENSE file.
4
5// Flags: --expose-wasm
6
7load("test/mjsunit/wasm/wasm-constants.js");
8
9try {
10 var data = bytes(
Ben Murdochc5610432016-08-08 18:44:38 +010011 kWasmFunctionTypeForm, 0, kAstStmt, // signature
12 kDeclNoLocals, // --
13 kExprNop // body
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000014 );
15
Ben Murdochda12d292016-06-02 14:46:10 +010016 Wasm.verifyFunction(data);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000017 print("ok");
18} catch (e) {
19 assertTrue(false);
20}
21
22
23var threw = false;
24try {
25 var data = bytes(
Ben Murdochc5610432016-08-08 18:44:38 +010026 kWasmFunctionTypeForm, 0, 1, kAstI32, // signature
27 kDeclNoLocals, // --
28 kExprBlock, kExprNop, kExprNop, kExprEnd // body
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000029 );
30
Ben Murdochda12d292016-06-02 14:46:10 +010031 Wasm.verifyFunction(data);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000032 print("not ok");
33} catch (e) {
34 print("ok: " + e);
35 threw = true;
36}
37
38assertTrue(threw);