mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Various changes in TVM, github builds and tests (#793)
* Bugfixes in TVM and node * Upgrade to C++17 * Improve GitHub builds * Fix existing tests and partially integrate them into builds --------- Co-authored-by: neodiX42 <namlem@gmail.com> Co-authored-by: EmelyanenkoK <emelyanenko.kirill@gmail.com>
This commit is contained in:
parent
89700cb2aa
commit
5847897b37
122 changed files with 2889 additions and 4100 deletions
|
@ -16,12 +16,12 @@
|
|||
*/
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <random>
|
||||
#include <getopt.h>
|
||||
#include "common/refcnt.hpp"
|
||||
#include "common/bigint.hpp"
|
||||
#include "common/refint.h"
|
||||
|
@ -211,7 +211,7 @@ bool coin() {
|
|||
|
||||
// returns 0 with probability 1/2, 1 with prob. 1/4, ..., k with prob. 1/2^(k+1)
|
||||
int randexp(int max = 63, int min = 0) {
|
||||
return min + __builtin_clzll(Random() | (1ULL << (63 - max + min)));
|
||||
return min + td::count_leading_zeroes64(Random() | (1ULL << (63 - max + min)));
|
||||
}
|
||||
|
||||
void bin_add_small(unsigned char bin[64], long long val, int shift = 0) {
|
||||
|
@ -363,7 +363,7 @@ void check_one_int_repr(td::RefInt256 x, int mode, int in_range, const BInt* val
|
|||
if (is_small) {
|
||||
// special check for small (64-bit) values
|
||||
CHECK(x->to_long() == xval);
|
||||
CHECK((long long)__builtin_bswap64(*(long long*)(bytes + 64 - 8)) == xval);
|
||||
CHECK((long long)td::bswap64(*(long long*)(bytes + 64 - 8)) == xval);
|
||||
CHECK(in_range);
|
||||
// check sign
|
||||
CHECK(x->sgn() == (xval > 0 ? 1 : (xval < 0 ? -1 : 0)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue