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

Side by Side Diff: test/mjsunit/wasm/asm-wasm.js

Issue 1574063005: [wasm] Fix double to int conversions. (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
« src/wasm/asm-wasm-builder.cc ('K') | « src/wasm/asm-wasm-builder.cc ('k') | 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 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 5 // Flags: --expose-wasm
6 6
7 function IntTest() { 7 function IntTest() {
8 "use asm"; 8 "use asm";
9 function sum(a, b) { 9 function sum(a, b) {
10 a = a|0; 10 a = a|0;
11 b = b|0; 11 b = b|0;
12 var c = (b + 1)|0 12 var c = (b + 1)|0
13 var d = 3.0;
14 var e = d | 0; // double conversion
13 return (a + c + 1)|0; 15 return (a + c + 1)|0;
14 } 16 }
15 17
16 function caller() { 18 function caller() {
17 return sum(77,22) | 0; 19 return sum(77,22) | 0;
18 } 20 }
19 21
20 return {caller: caller}; 22 return {caller: caller};
21 } 23 }
22 24
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 737 }
736 default: return 0; 738 default: return 0;
737 } 739 }
738 return 0; 740 return 0;
739 } 741 }
740 742
741 return {caller:caller}; 743 return {caller:caller};
742 } 744 }
743 745
744 assertEquals(43, WASM.asmCompileRun(TestNestedSwitch.toString())); 746 assertEquals(43, WASM.asmCompileRun(TestNestedSwitch.toString()));
OLDNEW
« src/wasm/asm-wasm-builder.cc ('K') | « src/wasm/asm-wasm-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698