2015-12-11 12:26:16 +00:00
|
|
|
// Copyright 2015 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2015-12-17 10:54:08 +00:00
|
|
|
// Flags: --expose-wasm
|
|
|
|
|
2015-12-11 12:26:16 +00:00
|
|
|
load("test/mjsunit/wasm/wasm-constants.js");
|
|
|
|
|
|
|
|
try {
|
|
|
|
var data = bytes(
|
|
|
|
0, kAstStmt, // signature
|
|
|
|
3, 0, // local int32 count
|
|
|
|
4, 0, // local int64 count
|
|
|
|
5, 0, // local float32 count
|
|
|
|
6, 0, // local float64 count
|
|
|
|
kExprNop // body
|
|
|
|
);
|
|
|
|
|
2016-01-12 20:16:21 +00:00
|
|
|
_WASMEXP_.verifyFunction(data);
|
2015-12-11 12:26:16 +00:00
|
|
|
print("ok");
|
|
|
|
} catch (e) {
|
|
|
|
assertTrue(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var threw = false;
|
|
|
|
try {
|
|
|
|
var data = bytes(
|
|
|
|
0, kAstI32, // signature
|
|
|
|
2, 0, // local int32 count
|
|
|
|
3, 0, // local int64 count
|
|
|
|
4, 0, // local float32 count
|
|
|
|
5, 0, // local float64 count
|
|
|
|
kExprBlock, 2, kExprNop, kExprNop // body
|
|
|
|
);
|
|
|
|
|
2016-01-12 20:16:21 +00:00
|
|
|
_WASMEXP_.verifyFunction(data);
|
2015-12-11 12:26:16 +00:00
|
|
|
print("not ok");
|
|
|
|
} catch (e) {
|
|
|
|
print("ok: " + e);
|
|
|
|
threw = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
assertTrue(threw);
|