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

Unified Diff: test/mjsunit/regress/wasm/regress-709684.js

Issue 2807013002: [wasm] Misc fixes for async compilation (Closed)
Patch Set: rename Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/wasm/regress-709684.js
diff --git a/test/mjsunit/regress/wasm/regress-709684.js b/test/mjsunit/regress/wasm/regress-709684.js
new file mode 100644
index 0000000000000000000000000000000000000000..1ca0cb63fdebe320a8c3100388fdc7d8712de6f1
--- /dev/null
+++ b/test/mjsunit/regress/wasm/regress-709684.js
@@ -0,0 +1,78 @@
+// Copyright 2017 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.
+
+// Flags: --expose-wasm --allow-natives-syntax
+
+load('test/mjsunit/wasm/wasm-constants.js');
+load('test/mjsunit/wasm/wasm-module-builder.js');
+
+let importingModuleBinary1 = (() => {
+ var builder = new WasmModuleBuilder();
+ builder.addImport('', 'f', kSig_i_v);
+ return new Int8Array(builder.toBuffer());
+})();
+
+let importingModuleBinary2 = (() => {
+ var builder = new WasmModuleBuilder();
+ builder.addImport('', 'f', kSig_i_v);
+ builder.addFunction('g', kSig_v_v)
+ .addBody([kExprNop]);
+ return new Int8Array(builder.toBuffer());
+})();
+
+let importingModuleBinary3 = (() => {
+ var builder = new WasmModuleBuilder();
+ builder.addImport('', 'f', kSig_i_v);
+ builder.addImport('', 'f2', kSig_i_v);
+ builder.addFunction('g', kSig_v_v)
+ .addBody([kExprNop]);
+ return new Int8Array(builder.toBuffer());
+})();
+
+let importingModuleBinary4 = (() => {
+ var builder = new WasmModuleBuilder();
+ builder.addFunction('g', kSig_v_v)
+ .addBody([kExprNop]);
+ return new Int8Array(builder.toBuffer());
+})();
+
+const complexImportingModuleBinary1 = (() => {
+ let builder = new WasmModuleBuilder();
+
+ builder.addImport('a', 'b', kSig_v_v);
+ builder.addImportedMemory('c', 'd', 1);
+ builder.addImportedTable('e', 'f', 1);
+ builder.addImportedGlobal('g', '⚡', kWasmI32);
+ builder.addFunction('g', kSig_v_v)
+ .addBody([kExprNop]);
+ return builder.toBuffer();
+})();
+
+const complexImportingModuleBinary2 = (() => {
+ let builder = new WasmModuleBuilder();
+
+ builder.addImport('a', 'b', kSig_v_v);
+ builder.addImportedMemory('c', 'd', 1);
+ builder.addImportedTable('e', 'f', 1);
+ builder.addImportedGlobal('g', '⚡', kWasmI32);
+ builder.addFunction('g', kSig_v_v)
+ .addBody([kExprNop]);
+ return builder.toBuffer();
+})();
+
+var tests = [
+ importingModuleBinary1,
+ importingModuleBinary2,
+ importingModuleBinary3,
+ importingModuleBinary4,
+ complexImportingModuleBinary1,
+ complexImportingModuleBinary2
+];
+
+for (var index in tests) {
+ assertPromiseResult(
+ WebAssembly.compile(tests[index]),
+ m => assertTrue(m instanceof WebAssembly.Module),
+ assertUnreachable);
+}
« no previous file with comments | « src/wasm/wasm-objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698