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

Side by Side Diff: test/mjsunit/wasm/divrem-trap.js

Issue 1896863003: [wasm] Binary 11: Module changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/calls.js ('k') | test/mjsunit/wasm/export-table.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 --expose-gc --allow-natives-syntax 5 // Flags: --expose-wasm --expose-gc --allow-natives-syntax
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 assertTraps(code, msg) { 10 function assertTraps(code, msg) {
(...skipping 15 matching lines...) Expand all
26 // Success. 26 // Success.
27 return; 27 return;
28 } 28 }
29 throw new MjsUnitAssertionError("Did not throw exception"); 29 throw new MjsUnitAssertionError("Did not throw exception");
30 } 30 }
31 31
32 32
33 function makeBinop(opcode) { 33 function makeBinop(opcode) {
34 var builder = new WasmModuleBuilder(); 34 var builder = new WasmModuleBuilder();
35 35
36 builder.addFunction("main", [kAstI32, kAstI32, kAstI32]) 36 builder.addFunction("main", kSig_i_ii)
37 .addBody([ 37 .addBody([
38 kExprGetLocal, 0, // -- 38 kExprGetLocal, 0, // --
39 kExprGetLocal, 1, // -- 39 kExprGetLocal, 1, // --
40 opcode, // -- 40 opcode, // --
41 ]) 41 ])
42 .exportFunc(); 42 .exportFunc();
43 43
44 return builder.instantiate().exports.main; 44 return builder.instantiate().exports.main;
45 } 45 }
46 46
(...skipping 26 matching lines...) Expand all
73 assertEquals( 3, remu(-443, 10)); 73 assertEquals( 3, remu(-443, 10));
74 74
75 assertTraps(kTrapRemByZero, "rems(100, 0);"); 75 assertTraps(kTrapRemByZero, "rems(100, 0);");
76 assertTraps(kTrapRemByZero, "rems(-1009, 0);"); 76 assertTraps(kTrapRemByZero, "rems(-1009, 0);");
77 77
78 assertTraps(kTrapRemByZero, "remu(200, 0);"); 78 assertTraps(kTrapRemByZero, "remu(200, 0);");
79 assertTraps(kTrapRemByZero, "remu(-2009, 0);"); 79 assertTraps(kTrapRemByZero, "remu(-2009, 0);");
80 80
81 assertEquals(-2147483648, remu(0x80000000, -1)); 81 assertEquals(-2147483648, remu(0x80000000, -1));
82 assertEquals(0, rems(0x80000000, -1)); 82 assertEquals(0, rems(0x80000000, -1));
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/calls.js ('k') | test/mjsunit/wasm/export-table.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698