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

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

Issue 1577803002: [wasm] Rename the WASM object to _WASMEXP_. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/compile-run-basic.js ('k') | test/mjsunit/wasm/ffi.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 8
9 function assertTraps(code, msg) { 9 function assertTraps(code, msg) {
10 var threwException = true; 10 var threwException = true;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 kBodySize, 0, 45 kBodySize, 0,
46 // main body 46 // main body
47 opcode, // -- 47 opcode, // --
48 kExprGetLocal, 0, // -- 48 kExprGetLocal, 0, // --
49 kExprGetLocal, 1, // -- 49 kExprGetLocal, 1, // --
50 // names 50 // names
51 kDeclEnd, 51 kDeclEnd,
52 'm', 'a', 'i', 'n', 0 // -- 52 'm', 'a', 'i', 'n', 0 // --
53 ); 53 );
54 54
55 var module = WASM.instantiateModule(data); 55 var module = _WASMEXP_.instantiateModule(data);
56 56
57 assertEquals("function", typeof module.main); 57 assertEquals("function", typeof module.main);
58 58
59 return module.main; 59 return module.main;
60 } 60 }
61 61
62 var divs = makeDivRem(kExprI32DivS); 62 var divs = makeDivRem(kExprI32DivS);
63 var divu = makeDivRem(kExprI32DivU); 63 var divu = makeDivRem(kExprI32DivU);
64 64
65 assertEquals( 33, divs( 333, 10)); 65 assertEquals( 33, divs( 333, 10));
(...skipping 22 matching lines...) Expand all
88 assertEquals( 3, remu(-443, 10)); 88 assertEquals( 3, remu(-443, 10));
89 89
90 assertTraps(kTrapRemByZero, "rems(100, 0);"); 90 assertTraps(kTrapRemByZero, "rems(100, 0);");
91 assertTraps(kTrapRemByZero, "rems(-1009, 0);"); 91 assertTraps(kTrapRemByZero, "rems(-1009, 0);");
92 92
93 assertTraps(kTrapRemByZero, "remu(200, 0);"); 93 assertTraps(kTrapRemByZero, "remu(200, 0);");
94 assertTraps(kTrapRemByZero, "remu(-2009, 0);"); 94 assertTraps(kTrapRemByZero, "remu(-2009, 0);");
95 95
96 assertEquals(-2147483648, remu(0x80000000, -1)); 96 assertEquals(-2147483648, remu(0x80000000, -1));
97 assertEquals(0, rems(0x80000000, -1)); 97 assertEquals(0, rems(0x80000000, -1));
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/compile-run-basic.js ('k') | test/mjsunit/wasm/ffi.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698