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

Side by Side Diff: test/mjsunit/wasm/globals.js

Issue 2696813002: [wasm] Inspect right control frames for unreachable flag (Closed)
Patch Set: Avoid conversion warning Created 3 years, 10 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 | « test/mjsunit/wasm/function-names.js ('k') | test/mjsunit/wasm/unreachable-validation.js » ('j') | 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 function TestImported(type, val, expected) { 10 function TestImported(type, val, expected) {
11 print("TestImported " + type + "(" + val +")" + " = " + expected); 11 print("TestImported " + type + "(" + val +")" + " = " + expected);
12 var builder = new WasmModuleBuilder(); 12 var builder = new WasmModuleBuilder();
13 var sig = makeSig([], [type]); 13 var sig = makeSig([], [type]);
14 var g = builder.addImportedGlobal("uuu", "foo", type); 14 var g = builder.addImportedGlobal("uuu", "foo", type);
15 builder.addFunction("main", sig) 15 builder.addFunction("main", sig)
16 .addBody([kExprGetGlobal, g.index]) 16 .addBody([kExprGetGlobal, g])
17 .exportAs("main"); 17 .exportAs("main");
18 builder.addGlobal(kWasmI32); // pad 18 builder.addGlobal(kWasmI32); // pad
19 19
20 var instance = builder.instantiate({uuu: {foo: val}}); 20 var instance = builder.instantiate({uuu: {foo: val}});
21 assertEquals(expected, instance.exports.main()); 21 assertEquals(expected, instance.exports.main());
22 } 22 }
23 23
24 TestImported(kWasmI32, 300.1, 300); 24 TestImported(kWasmI32, 300.1, 300);
25 TestImported(kWasmF32, 87234.87238, Math.fround(87234.87238)); 25 TestImported(kWasmF32, 87234.87238, Math.fround(87234.87238));
26 TestImported(kWasmF64, 77777.88888, 77777.88888); 26 TestImported(kWasmF64, 77777.88888, 77777.88888);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 .addBody([kExprGetGlobal, def.index]) 89 .addBody([kExprGetGlobal, def.index])
90 .exportAs("main"); 90 .exportAs("main");
91 91
92 var instance = builder.instantiate({nnn: {foo: val}}); 92 var instance = builder.instantiate({nnn: {foo: val}});
93 assertEquals(val, instance.exports.main()); 93 assertEquals(val, instance.exports.main());
94 } 94 }
95 95
96 TestGlobalIndexSpace(kWasmI32, 123); 96 TestGlobalIndexSpace(kWasmI32, 123);
97 TestGlobalIndexSpace(kWasmF32, 54321.125); 97 TestGlobalIndexSpace(kWasmF32, 54321.125);
98 TestGlobalIndexSpace(kWasmF64, 12345.678); 98 TestGlobalIndexSpace(kWasmF64, 12345.678);
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/function-names.js ('k') | test/mjsunit/wasm/unreachable-validation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698