blob: 4b16b712398e403502072fd82c3305e3f21d993d [file] [log] [blame]
Ben Murdochda12d292016-06-02 14:46:10 +01001// Copyright 2016 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// Flags: --allow-natives-syntax
7
8(function TestDeoptimizeArgMismatch() {
9 function deopt() {
10 %DeoptimizeFunction(test);
11 }
12 function Module(global, env, buffer) {
13 "use asm";
14 var deopt = env.deopt;
15 function _main(i4, i5) {
16 i4 = i4 | 0;
17 i5 = i5 | 0;
18 deopt();
19 return i5 | 0;
20 }
21 return {'_main': _main}
22 }
23 function test() {
24 var wasm = Wasm.instantiateModuleFromAsm(
25 Module.toString(), {'deopt': deopt});
26 wasm._main(0, 0, 0);
27 }
28 test();
29})();