OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 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(32, 32, false); |
| 11 builder.addFunction("test", kSig_i_iii) |
| 12 .addBodyWithEnd([ |
| 13 // body: |
| 14 kExprI64Const, 0xa2, 0xc5, 0x8a, 0x95, 0xaa, 0xd4, 0xa8, 0x80, 0x80, 0x00, |
| 15 kExprI64Const, 0xff, 0xff, 0xeb, 0xa9, 0x85, 0x80, 0x80, 0x80, 0x80, 0x00, |
| 16 kExprI64Mul, |
| 17 kExprI64Const, 0xa8, 0x81, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, |
| 18 kExprI64Add, |
| 19 kExprBlock, 0x7e, // @36 i64 |
| 20 kExprBlock, 0x7e, // @38 i64 |
| 21 kExprI64Const, 0xa2, 0x81, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, |
| 22 kExprI64Const, 0xa2, 0xc5, 0x8a, 0x85, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, |
| 23 kExprI64Const, 0xa2, 0xc5, 0x82, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, |
| 24 kExprI64Mul, |
| 25 kExprI64Mul, |
| 26 kExprEnd, // @75 |
| 27 kExprEnd, // @76 |
| 28 kExprI64Add, |
| 29 kExprI64Const, 0xa2, 0x81, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, |
| 30 kExprI64Const, 0xef, 0xff, 0x8b, 0x95, 0xaa, 0xd4, 0xa8, 0xd1, 0x80, 0x00, |
| 31 kExprI64Mul, |
| 32 kExprI64GeS, |
| 33 kExprEnd, // @102 |
| 34 ]) |
| 35 .exportFunc(); |
| 36 var module = builder.instantiate(); |
| 37 assertEquals(1, module.exports.test(1, 2, 3)); |
| 38 })(); |
OLD | NEW |