OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
6 #include "vm/bigint_operations.h" | 6 #include "vm/bigint_operations.h" |
7 #include "vm/object.h" | 7 #include "vm/object.h" |
8 #include "vm/object_store.h" | 8 #include "vm/object_store.h" |
9 #include "vm/unit_test.h" | 9 #include "vm/unit_test.h" |
10 | 10 |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 TestBigintBitNot("0x50000000", "-0x50000001"); | 1333 TestBigintBitNot("0x50000000", "-0x50000001"); |
1334 TestBigintBitNot("0xFFFFFFF", "-0x10000000"); | 1334 TestBigintBitNot("0xFFFFFFF", "-0x10000000"); |
1335 TestBigintBitNot("0xFFFFFFFF", "-0x100000000"); | 1335 TestBigintBitNot("0xFFFFFFFF", "-0x100000000"); |
1336 TestBigintBitNot("0xFFFFFFFFFFFFFF", "-0x100000000000000"); | 1336 TestBigintBitNot("0xFFFFFFFFFFFFFF", "-0x100000000000000"); |
1337 TestBigintBitNot("0xFFFFFFFFFFFFFFFF", "-0x10000000000000000"); | 1337 TestBigintBitNot("0xFFFFFFFFFFFFFFFF", "-0x10000000000000000"); |
1338 TestBigintBitNot("0x1234567890ABCDEF012345678", | 1338 TestBigintBitNot("0x1234567890ABCDEF012345678", |
1339 "-0x1234567890ABCDEF012345679"); | 1339 "-0x1234567890ABCDEF012345679"); |
1340 } | 1340 } |
1341 | 1341 |
1342 | 1342 |
1343 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 1343 #if defined(TARGET_ARCH_IA32) || \ |
| 1344 defined(TARGET_ARCH_X64) || \ |
| 1345 defined(TARGET_ARCH_ARM) |
1344 static void TestBigintMultiplyDivide(const char* a, | 1346 static void TestBigintMultiplyDivide(const char* a, |
1345 const char* b, | 1347 const char* b, |
1346 const char* product) { | 1348 const char* product) { |
1347 const Bigint& bigint_a = Bigint::Handle(BigintOperations::NewFromCString(a)); | 1349 const Bigint& bigint_a = Bigint::Handle(BigintOperations::NewFromCString(a)); |
1348 const Bigint& bigint_b = Bigint::Handle(BigintOperations::NewFromCString(b)); | 1350 const Bigint& bigint_b = Bigint::Handle(BigintOperations::NewFromCString(b)); |
1349 const Bigint& computed_product = | 1351 const Bigint& computed_product = |
1350 Bigint::Handle(BigintOperations::Multiply(bigint_a, bigint_b)); | 1352 Bigint::Handle(BigintOperations::Multiply(bigint_a, bigint_b)); |
1351 const char* str_product = BigintOperations::ToHexCString(computed_product, | 1353 const char* str_product = BigintOperations::ToHexCString(computed_product, |
1352 &ZoneAllocator); | 1354 &ZoneAllocator); |
1353 EXPECT_STREQ(product, str_product); | 1355 EXPECT_STREQ(product, str_product); |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2225 "123456789012345678901234567890123456789012345678901234567890123456789012" | 2227 "123456789012345678901234567890123456789012345678901234567890123456789012" |
2226 "345678901234567890123456789012345678901234567890123456789012345678901234" | 2228 "345678901234567890123456789012345678901234567890123456789012345678901234" |
2227 "567890123456789012345678901234567890123456789012345678901234567890123456" | 2229 "567890123456789012345678901234567890123456789012345678901234567890123456" |
2228 "789012345678901234567890123456789012345678901234567890123456789012345678" | 2230 "789012345678901234567890123456789012345678901234567890123456789012345678" |
2229 "90123456789012345678901234567890", | 2231 "90123456789012345678901234567890", |
2230 "0x1234567890ABCDEF01234567890ABCDEF01234567890ABCDEF01234567890ABCDEF" | 2232 "0x1234567890ABCDEF01234567890ABCDEF01234567890ABCDEF01234567890ABCDEF" |
2231 "01234567890ABCDEE"); | 2233 "01234567890ABCDEE"); |
2232 } | 2234 } |
2233 | 2235 |
2234 } // namespace dart | 2236 } // namespace dart |
OLD | NEW |