Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: test/mjsunit/wasm/test-wasm-module-builder.js

Issue 1769873002: [wasm] One more fix to test-wasm-module-builder.js (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // 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 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 load('test/mjsunit/wasm/wasm-module-builder.js'); 8 load('test/mjsunit/wasm/wasm-module-builder.js');
9 9
10 var debug = false;
11
10 (function BasicTest() { 12 (function BasicTest() {
11 var module = new WasmModuleBuilder(); 13 var module = new WasmModuleBuilder();
12 module.addMemory(1, 2, false); 14 module.addMemory(1, 2, false);
13 module.addFunction("foo", [kAstI32]) 15 module.addFunction("foo", [kAstI32])
14 .addBody([kExprI8Const, 11]) 16 .addBody([kExprI8Const, 11])
15 .exportAs("blarg"); 17 .exportAs("blarg");
16 18
17 var buffer = module.toBuffer(debug); 19 var buffer = module.toBuffer(debug);
18 var instance = _WASMEXP_.instantiateModule(buffer); 20 var instance = _WASMEXP_.instantiateModule(buffer);
19 assertEquals(11, instance.exports.blarg()); 21 assertEquals(11, instance.exports.blarg());
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 module.addMemory(1, 1, false); 81 module.addMemory(1, 1, false);
80 module.addFunction("load", [kAstI32, kAstI32]) 82 module.addFunction("load", [kAstI32, kAstI32])
81 .addBody([kExprI32LoadMem, 0, kExprGetLocal, 0]) 83 .addBody([kExprI32LoadMem, 0, kExprGetLocal, 0])
82 .exportAs("load"); 84 .exportAs("load");
83 module.addDataSegment(0, [9, 9, 9, 9], true); 85 module.addDataSegment(0, [9, 9, 9, 9], true);
84 86
85 var buffer = module.toBuffer(debug); 87 var buffer = module.toBuffer(debug);
86 var instance = _WASMEXP_.instantiateModule(buffer); 88 var instance = _WASMEXP_.instantiateModule(buffer);
87 assertEquals(151587081, instance.exports.load(0)); 89 assertEquals(151587081, instance.exports.load(0));
88 })(); 90 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698