OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 for (var i = 0; i < example_numbers.length; i++) { | 147 for (var i = 0; i < example_numbers.length; i++) { |
148 for (var j = 0; j < example_numbers.length; j++) { | 148 for (var j = 0; j < example_numbers.length; j++) { |
149 var a = example_numbers[i]; | 149 var a = example_numbers[i]; |
150 var b = example_numbers[j]; | 150 var b = example_numbers[j]; |
151 doTest(a,b); | 151 doTest(a,b); |
152 doTest(-a,b); | 152 doTest(-a,b); |
153 doTest(a,-b); | 153 doTest(a,-b); |
154 doTest(-a,-b); | 154 doTest(-a,-b); |
155 } | 155 } |
156 } | 156 } |
157 })() | 157 })(); |
| 158 |
| 159 |
| 160 (function () { |
| 161 // Edge cases |
| 162 var zero = 0; |
| 163 var minsmi32 = -0x40000000; |
| 164 var minsmi64 = -0x80000000; |
| 165 var somenum = 3532; |
| 166 assertEquals(-0, zero / -1, "0 / -1"); |
| 167 assertEquals(1, minsmi32 / -0x40000000, "minsmi/minsmi-32"); |
| 168 assertEquals(1, minsmi64 / -0x80000000, "minsmi/minsmi-64"); |
| 169 assertEquals(somenum, somenum % -0x40000000, "%minsmi-32"); |
| 170 assertEquals(somenum, somenum % -0x80000000, "%minsmi-64"); |
| 171 })(); |
OLD | NEW |