diff options
Diffstat (limited to 'deps/v8/test/mjsunit/lexicographic-compare.js')
-rw-r--r-- | deps/v8/test/mjsunit/lexicographic-compare.js | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/deps/v8/test/mjsunit/lexicographic-compare.js b/deps/v8/test/mjsunit/lexicographic-compare.js deleted file mode 100644 index b87dd1c1ef..0000000000 --- a/deps/v8/test/mjsunit/lexicographic-compare.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Flags: --allow-natives-syntax - -(function () { - - assertFalse(%IsSmi(2147483648), 'Update test for >32 bit Smi'); - - // Collect a list of interesting Smis. - const seen = {}; - const smis = []; - function add(x) { - if (x | 0 == x) { - x = x | 0; // Canonicalizes to Smi if 32-bit signed and fits in Smi. - } - if (%_IsSmi(x) && !seen[x]) { - seen[x] = 1; - smis.push(x); - } - } - function addSigned(x) { - add(x); - add(-x); - } - - var BIGGER_THAN_ANY_SMI = 10 * 1000 * 1000 * 1000; - for (var xb = 1; xb <= BIGGER_THAN_ANY_SMI; xb *= 10) { - for (var xf = 0; xf <= 9; xf++) { - for (var xo = -1; xo <= 1; xo++) { - addSigned(xb * xf + xo); - } - } - } - - console.log("A") - - for (var yb = 1; yb <= BIGGER_THAN_ANY_SMI; yb *= 2) { - for (var yo = -2; yo <= 2; yo++) { - addSigned(yb + yo); - } - } - - function test(x,y) { - const lex = %SmiLexicographicCompare(x, y); - const expected = (x == y) ? 0 : (("" + x) < ("" + y) ? -1 : 1); - return lex == expected; - } - - console.log(smis.length); - - for (var i = 0; i < smis.length; i++) { - for (var j = 0; j < smis.length; j++) { - const x = smis[i]; - const y = smis[j]; - assertTrue(test(x, y), x + " < " + y);; - } - } - - console.log("C") -})(); |