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

Side by Side Diff: test/mjsunit/switch.js

Issue 9320: Semi-weekly merge from bleeding_edge to the toiger branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 12 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/fuzz-natives.js ('k') | tools/test.py » ('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 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 217 }
218 } 218 }
219 return res; 219 return res;
220 } 220 }
221 221
222 assertEquals(190, f6(20), "largeSwitch.20"); 222 assertEquals(190, f6(20), "largeSwitch.20");
223 assertEquals(2016, f6(64), "largeSwitch.64"); 223 assertEquals(2016, f6(64), "largeSwitch.64");
224 assertEquals(4032, f6(128), "largeSwitch.128"); 224 assertEquals(4032, f6(128), "largeSwitch.128");
225 assertEquals(4222, f6(148), "largeSwitch.148"); 225 assertEquals(4222, f6(148), "largeSwitch.148");
226 226
227 227
228 function f7(value) {
229 switch (value) {
230 case 0: return "0";
231 case -0: return "-0";
232 case 1: case 2: case 3: case 4: // Dummy fillers.
233 }
234 switch (value) {
235 case 0x3fffffff: return "MaxSmi";
236 case 0x3ffffffe:
237 case 0x3ffffffd:
238 case 0x3ffffffc:
239 case 0x3ffffffb:
240 case 0x3ffffffa: // Dummy fillers
241 }
242 switch (value) {
243 case -0x40000000: return "MinSmi";
244 case -0x3fffffff:
245 case -0x3ffffffe:
246 case -0x3ffffffd:
247 case -0x3ffffffc:
248 case -0x3ffffffb: // Dummy fillers
249 }
250 switch (value) {
251 case 10: return "A";
252 case 11:
253 case 12:
254 case 13:
255 case 14:
256 case 15: // Dummy fillers
257 }
258 return "default";
259 }
260
261
262 assertEquals("default", f7(0.1), "0-1-switch.double-0.1");
263 assertEquals("0", f7(-0), "0-1-switch.double-neg0");
264 assertEquals("MaxSmi", f7((1<<30)-1), "0-1-switch.maxsmi");
265 assertEquals("MinSmi", f7(-(1<<30)), "0-1-switch.minsmi");
266 assertEquals("default", f7(1<<30), "0-1-switch.maxsmi++");
267 assertEquals("default", f7(-(1<<30)-1), "0-1-switch.minsmi--");
268 assertEquals("A", f7((170/16)-(170%16/16)), "0-1-switch.heapnum");
269
OLDNEW
« no previous file with comments | « test/mjsunit/fuzz-natives.js ('k') | tools/test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698