dec.js 2.43 KB
Newer Older
1 2 3 4 5 6 7
// Copyright 2017 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.

// Generated by tools/bigint-tester.py.

var data = [{
8 9
  a: 0x26ffcdbd233a53e7ca4612f2b02e1f2c1d885c3177e7n,
  r: 0x26ffcdbd233a53e7ca4612f2b02e1f2c1d885c3177e6n
10
}, {
11 12
  a: 0xf2a29a35193377a223ef0d6d98db95eeb24a4165f288fd2b4an,
  r: 0xf2a29a35193377a223ef0d6d98db95eeb24a4165f288fd2b49n
13
}, {
14 15
  a: 0x454d22e29e6104n,
  r: 0x454d22e29e6103n
16
}, {
17 18
  a: -0xb00874640d30e6fce6bf79508378ed17e44dacb48a4200bce536cec462b3c2n,
  r: -0xb00874640d30e6fce6bf79508378ed17e44dacb48a4200bce536cec462b3c3n
19
}, {
20 21
  a: 0x4c151a24d765249c2bab4a1915b24b80ae437417c5n,
  r: 0x4c151a24d765249c2bab4a1915b24b80ae437417c4n
22
}, {
23 24
  a: -0xcbd476b1f9ca08ff820941n,
  r: -0xcbd476b1f9ca08ff820942n
25
}, {
26 27
  a: -0xe848e5830fa1035322b39c2cdd031109ca8n,
  r: -0xe848e5830fa1035322b39c2cdd031109ca9n
28
}, {
29 30
  a: -0x4d58c5e190f0ebac5bb36ca4d214069f69726c63a5n,
  r: -0x4d58c5e190f0ebac5bb36ca4d214069f69726c63a6n
31
}, {
32 33
  a: 0x9b396n,
  r: 0x9b395n
34
}, {
35 36
  a: 0x593921fe8b9d4906cn,
  r: 0x593921fe8b9d4906bn
37
}, {
38 39
  a: -0xe127928c7cecd6e9ca94d98e858f9c76a0fccac62203aac7710cef1f9e352n,
  r: -0xe127928c7cecd6e9ca94d98e858f9c76a0fccac62203aac7710cef1f9e353n
40
}, {
41 42
  a: 0xeb14cd952d06eb6fc613016f73b7339cbdd010n,
  r: 0xeb14cd952d06eb6fc613016f73b7339cbdd00fn
43
}, {
44 45
  a: -0xfdeab6a3dbd603137f680413fecc9e1c80n,
  r: -0xfdeab6a3dbd603137f680413fecc9e1c81n
46
}, {
47 48
  a: -0x7e9abbdfad170df2129dae8e15088a02b9ba99276a351a05n,
  r: -0x7e9abbdfad170df2129dae8e15088a02b9ba99276a351a06n
49
}, {
50 51
  a: 0x7b98f57n,
  r: 0x7b98f56n
52
}, {
53 54
  a: -0x919751deb470faa60d7c5c995c8bed72f9542d710fbbf1341n,
  r: -0x919751deb470faa60d7c5c995c8bed72f9542d710fbbf1342n
55
}, {
56 57
  a: -0xc5541d89b118a88afdd187228440427c8a24f9d9bn,
  r: -0xc5541d89b118a88afdd187228440427c8a24f9d9cn
58
}, {
59 60
  a: -0xe6c88a170595fn,
  r: -0xe6c88a1705960n
61
}, {
62 63
  a: -0xa1ffbfa388c332804dc4dc973n,
  r: -0xa1ffbfa388c332804dc4dc974n
64
}, {
65 66
  a: 0x67b768ce0c415127a77402861d1901dd7f60a8624ebea6ecafe03adc3cen,
  r: 0x67b768ce0c415127a77402861d1901dd7f60a8624ebea6ecafe03adc3cdn
67 68 69 70 71
}];

var error_count = 0;
for (var i = 0; i < data.length; i++) {
  var d = data[i];
72 73 74
  var r = --d.a;
  if (d.r !== r) {
    print("Input:    " + d.a.toString(16));
75 76 77 78 79 80 81 82 83
    print("Result:   " + r.toString(16));
    print("Expected: " + d.r);
    error_count++;
  }
}
if (error_count !== 0) {
  print("Finished with " + error_count + " errors.")
  quit(1);
}