i128_and_intrinsic_identity_ut.cpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. #include "int128_ut_helpers.h"
  2. #include <library/cpp/testing/unittest/registar.h>
  3. #include <library/cpp/int128/int128.h>
  4. #include <util/generic/cast.h>
  5. #include <array>
  6. #include <type_traits>
  7. #if defined(Y_HAVE_INT128)
  8. bool IsIdentical(const i128 a, const signed __int128 b) {
  9. const std::array<ui8, 16> arrayA = NInt128Private::GetAsArray(a);
  10. const std::array<ui8, 16> arrayB = NInt128Private::GetAsArray(b);
  11. return arrayA == arrayB;
  12. }
  13. Y_UNIT_TEST_SUITE(i128_And_i8_BitwiseIdentity) {
  14. Y_UNIT_TEST(i128_from_i8_Zero) {
  15. i8 n = 0;
  16. i128 t1{n};
  17. signed __int128 t2{n};
  18. UNIT_ASSERT(IsIdentical(t1, t2));
  19. }
  20. Y_UNIT_TEST(i128_from_i8_Minus1) {
  21. i8 n = -1;
  22. i128 t1{n};
  23. signed __int128 t2{n};
  24. UNIT_ASSERT(IsIdentical(t1, t2));
  25. }
  26. Y_UNIT_TEST(i128_from_i8_Plus1) {
  27. i8 n = 1;
  28. i128 t1{n};
  29. signed __int128 t2{n};
  30. UNIT_ASSERT(IsIdentical(t1, t2));
  31. }
  32. Y_UNIT_TEST(i128_from_i8_Minus42) {
  33. i8 n = -42;
  34. i128 t1{n};
  35. signed __int128 t2{n};
  36. UNIT_ASSERT(IsIdentical(t1, t2));
  37. }
  38. Y_UNIT_TEST(i128_from_i8_Plus42) {
  39. i8 n = 42;
  40. i128 t1{n};
  41. signed __int128 t2{n};
  42. UNIT_ASSERT(IsIdentical(t1, t2));
  43. }
  44. Y_UNIT_TEST(i128_from_i8_Min) {
  45. i8 n = std::numeric_limits<i8>::min();
  46. i128 t1{n};
  47. signed __int128 t2{n};
  48. UNIT_ASSERT(IsIdentical(t1, t2));
  49. }
  50. Y_UNIT_TEST(i128_from_i8_Max) {
  51. i8 n = std::numeric_limits<i8>::max();
  52. i128 t1{n};
  53. signed __int128 t2{n};
  54. UNIT_ASSERT(IsIdentical(t1, t2));
  55. }
  56. Y_UNIT_TEST(i128_from_i8_MinPlus1) {
  57. i8 n = std::numeric_limits<i8>::min() + 1;
  58. i128 t1{n};
  59. signed __int128 t2{n};
  60. UNIT_ASSERT(IsIdentical(t1, t2));
  61. }
  62. Y_UNIT_TEST(i128_from_i8_MaxMinus1) {
  63. i8 n = std::numeric_limits<i8>::max() - 1;
  64. i128 t1{n};
  65. signed __int128 t2{n};
  66. UNIT_ASSERT(IsIdentical(t1, t2));
  67. }
  68. }
  69. Y_UNIT_TEST_SUITE(i128_And_i16_BitwiseIdentity) {
  70. Y_UNIT_TEST(i128_from_i16_Zero) {
  71. i16 n = 0;
  72. i128 t1{n};
  73. signed __int128 t2{n};
  74. UNIT_ASSERT(IsIdentical(t1, t2));
  75. }
  76. Y_UNIT_TEST(i128_from_i16_Minus1) {
  77. i16 n = -1;
  78. i128 t1{n};
  79. signed __int128 t2{n};
  80. UNIT_ASSERT(IsIdentical(t1, t2));
  81. }
  82. Y_UNIT_TEST(i128_from_i16_Plus1) {
  83. i16 n = 1;
  84. i128 t1{n};
  85. signed __int128 t2{n};
  86. UNIT_ASSERT(IsIdentical(t1, t2));
  87. }
  88. Y_UNIT_TEST(i128_from_i16_Minus42) {
  89. i16 n = -42;
  90. i128 t1{n};
  91. signed __int128 t2{n};
  92. UNIT_ASSERT(IsIdentical(t1, t2));
  93. }
  94. Y_UNIT_TEST(i128_from_i16_Plus42) {
  95. i16 n = 42;
  96. i128 t1{n};
  97. signed __int128 t2{n};
  98. UNIT_ASSERT(IsIdentical(t1, t2));
  99. }
  100. Y_UNIT_TEST(i128_from_i16_Min) {
  101. i16 n = std::numeric_limits<i16>::min();
  102. i128 t1{n};
  103. signed __int128 t2{n};
  104. UNIT_ASSERT(IsIdentical(t1, t2));
  105. }
  106. Y_UNIT_TEST(i128_from_i16_Max) {
  107. i16 n = std::numeric_limits<i16>::max();
  108. i128 t1{n};
  109. signed __int128 t2{n};
  110. UNIT_ASSERT(IsIdentical(t1, t2));
  111. }
  112. Y_UNIT_TEST(i128_from_i16_MinPlus1) {
  113. i16 n = std::numeric_limits<i16>::min() + 1;
  114. i128 t1{n};
  115. signed __int128 t2{n};
  116. UNIT_ASSERT(IsIdentical(t1, t2));
  117. }
  118. Y_UNIT_TEST(i128_from_i16_MaxMinus1) {
  119. i16 n = std::numeric_limits<i16>::max() - 1;
  120. i128 t1{n};
  121. signed __int128 t2{n};
  122. UNIT_ASSERT(IsIdentical(t1, t2));
  123. }
  124. }
  125. Y_UNIT_TEST_SUITE(i128_And_i32_BitwiseIdentity) {
  126. Y_UNIT_TEST(i128_from_i32_Zero) {
  127. i32 n = 0;
  128. i128 t1{n};
  129. signed __int128 t2{n};
  130. UNIT_ASSERT(IsIdentical(t1, t2));
  131. }
  132. Y_UNIT_TEST(i128_from_i32_Minus1) {
  133. i32 n = -1;
  134. i128 t1{n};
  135. signed __int128 t2{n};
  136. UNIT_ASSERT(IsIdentical(t1, t2));
  137. }
  138. Y_UNIT_TEST(i128_from_i32_Plus1) {
  139. i32 n = 1;
  140. i128 t1{n};
  141. signed __int128 t2{n};
  142. UNIT_ASSERT(IsIdentical(t1, t2));
  143. }
  144. Y_UNIT_TEST(i128_from_i32_Minus42) {
  145. i32 n = -42;
  146. i128 t1{n};
  147. signed __int128 t2{n};
  148. UNIT_ASSERT(IsIdentical(t1, t2));
  149. }
  150. Y_UNIT_TEST(i128_from_i32_Plus42) {
  151. i32 n = 42;
  152. i128 t1{n};
  153. signed __int128 t2{n};
  154. UNIT_ASSERT(IsIdentical(t1, t2));
  155. }
  156. Y_UNIT_TEST(i128_from_i32_Min) {
  157. i32 n = std::numeric_limits<i32>::min();
  158. i128 t1{n};
  159. signed __int128 t2{n};
  160. UNIT_ASSERT(IsIdentical(t1, t2));
  161. }
  162. Y_UNIT_TEST(i128_from_i32_Max) {
  163. i32 n = std::numeric_limits<i32>::max();
  164. i128 t1{n};
  165. signed __int128 t2{n};
  166. UNIT_ASSERT(IsIdentical(t1, t2));
  167. }
  168. Y_UNIT_TEST(i128_from_i32_MinPlus1) {
  169. i32 n = std::numeric_limits<i32>::min() + 1;
  170. i128 t1{n};
  171. signed __int128 t2{n};
  172. UNIT_ASSERT(IsIdentical(t1, t2));
  173. }
  174. Y_UNIT_TEST(i128_from_i32_MaxMinus1) {
  175. i32 n = std::numeric_limits<i32>::max() - 1;
  176. i128 t1{n};
  177. signed __int128 t2{n};
  178. UNIT_ASSERT(IsIdentical(t1, t2));
  179. }
  180. }
  181. Y_UNIT_TEST_SUITE(i128_And_i64_BitwiseIdentity) {
  182. Y_UNIT_TEST(i128_from_i64_Zero) {
  183. i64 n = 0;
  184. i128 t1{n};
  185. signed __int128 t2{n};
  186. UNIT_ASSERT(IsIdentical(t1, t2));
  187. }
  188. Y_UNIT_TEST(i128_from_i64_Minus1) {
  189. i64 n = -1;
  190. i128 t1{n};
  191. signed __int128 t2{n};
  192. UNIT_ASSERT(IsIdentical(t1, t2));
  193. }
  194. Y_UNIT_TEST(i128_from_i64_Plus1) {
  195. i64 n = 1;
  196. i128 t1{n};
  197. signed __int128 t2{n};
  198. UNIT_ASSERT(IsIdentical(t1, t2));
  199. }
  200. Y_UNIT_TEST(i128_from_i64_Minus42) {
  201. i64 n = -42;
  202. i128 t1{n};
  203. signed __int128 t2{n};
  204. UNIT_ASSERT(IsIdentical(t1, t2));
  205. }
  206. Y_UNIT_TEST(i128_from_i64_Plus42) {
  207. i64 n = 42;
  208. i128 t1{n};
  209. signed __int128 t2{n};
  210. UNIT_ASSERT(IsIdentical(t1, t2));
  211. }
  212. Y_UNIT_TEST(i128_from_i64_Min) {
  213. i64 n = std::numeric_limits<i64>::min();
  214. i128 t1{n};
  215. signed __int128 t2{n};
  216. UNIT_ASSERT(IsIdentical(t1, t2));
  217. }
  218. Y_UNIT_TEST(i128_from_i64_Max) {
  219. i64 n = std::numeric_limits<i64>::max();
  220. i128 t1{n};
  221. signed __int128 t2{n};
  222. UNIT_ASSERT(IsIdentical(t1, t2));
  223. }
  224. Y_UNIT_TEST(i128_from_i64_MinPlus1) {
  225. i64 n = std::numeric_limits<i64>::min() + 1;
  226. i128 t1{n};
  227. signed __int128 t2{n};
  228. UNIT_ASSERT(IsIdentical(t1, t2));
  229. }
  230. Y_UNIT_TEST(i128_from_i64_MaxMinus1) {
  231. i64 n = std::numeric_limits<i64>::max() - 1;
  232. i128 t1{n};
  233. signed __int128 t2{n};
  234. UNIT_ASSERT(IsIdentical(t1, t2));
  235. }
  236. }
  237. Y_UNIT_TEST_SUITE(i128_And_signed_int128_BitwiseIdentity) {
  238. Y_UNIT_TEST(i128_from_signed_int128_Zero) {
  239. signed __int128 n = 0;
  240. i128 t1{n};
  241. signed __int128 t2{n};
  242. UNIT_ASSERT(IsIdentical(t1, t2));
  243. }
  244. Y_UNIT_TEST(i128_from_signed_int128_Minus1) {
  245. signed __int128 n = -1;
  246. i128 t1{n};
  247. signed __int128 t2{n};
  248. UNIT_ASSERT(IsIdentical(t1, t2));
  249. }
  250. Y_UNIT_TEST(i128_from_signed_int128_Plus1) {
  251. signed __int128 n = 1;
  252. i128 t1{n};
  253. signed __int128 t2{n};
  254. UNIT_ASSERT(IsIdentical(t1, t2));
  255. }
  256. Y_UNIT_TEST(i128_from_signed_int128_Minus42) {
  257. signed __int128 n = -42;
  258. i128 t1{n};
  259. signed __int128 t2{n};
  260. UNIT_ASSERT(IsIdentical(t1, t2));
  261. }
  262. Y_UNIT_TEST(i128_from_signed_int128_Plus42) {
  263. signed __int128 n = 42;
  264. i128 t1{n};
  265. signed __int128 t2{n};
  266. UNIT_ASSERT(IsIdentical(t1, t2));
  267. }
  268. Y_UNIT_TEST(i128_from_signed_int128_Min) {
  269. signed __int128 n = std::numeric_limits<signed __int128>::min();
  270. i128 t1{n};
  271. signed __int128 t2{n};
  272. UNIT_ASSERT(IsIdentical(t1, t2));
  273. }
  274. Y_UNIT_TEST(i128_from_signed_int128_Max) {
  275. signed __int128 n = std::numeric_limits<signed __int128>::max();
  276. i128 t1{n};
  277. signed __int128 t2{n};
  278. UNIT_ASSERT(IsIdentical(t1, t2));
  279. }
  280. Y_UNIT_TEST(i128_from_signed_int128_MinPlus1) {
  281. signed __int128 n = std::numeric_limits<signed __int128>::min() + 1;
  282. i128 t1{n};
  283. signed __int128 t2{n};
  284. UNIT_ASSERT(IsIdentical(t1, t2));
  285. }
  286. Y_UNIT_TEST(i128_from_signed_int128_MaxMinus1) {
  287. signed __int128 n = std::numeric_limits<signed __int128>::max() - 1;
  288. i128 t1{n};
  289. signed __int128 t2{n};
  290. UNIT_ASSERT(IsIdentical(t1, t2));
  291. }
  292. }
  293. Y_UNIT_TEST_SUITE(i128_And_ui8_BitwiseIdentity) {
  294. Y_UNIT_TEST(i128_from_ui8_Zero) {
  295. ui8 n = 0;
  296. i128 t1{n};
  297. signed __int128 t2{n};
  298. UNIT_ASSERT(IsIdentical(t1, t2));
  299. }
  300. Y_UNIT_TEST(i128_from_ui8_Plus1) {
  301. ui8 n = 1;
  302. i128 t1{n};
  303. signed __int128 t2{n};
  304. UNIT_ASSERT(IsIdentical(t1, t2));
  305. }
  306. Y_UNIT_TEST(i128_from_ui8_Plus42) {
  307. ui8 n = 42;
  308. i128 t1{n};
  309. signed __int128 t2{n};
  310. UNIT_ASSERT(IsIdentical(t1, t2));
  311. }
  312. Y_UNIT_TEST(i128_from_ui8_Min) {
  313. ui8 n = std::numeric_limits<i8>::min();
  314. i128 t1{n};
  315. signed __int128 t2{n};
  316. UNIT_ASSERT(IsIdentical(t1, t2));
  317. }
  318. Y_UNIT_TEST(i128_from_ui8_Max) {
  319. ui8 n = std::numeric_limits<i8>::max();
  320. i128 t1{n};
  321. signed __int128 t2{n};
  322. UNIT_ASSERT(IsIdentical(t1, t2));
  323. }
  324. Y_UNIT_TEST(i128_from_ui8_MinPlus1) {
  325. ui8 n = std::numeric_limits<i8>::min() + 1;
  326. i128 t1{n};
  327. signed __int128 t2{n};
  328. UNIT_ASSERT(IsIdentical(t1, t2));
  329. }
  330. Y_UNIT_TEST(i128_from_ui8_MaxMinus1) {
  331. ui8 n = std::numeric_limits<i8>::max() - 1;
  332. i128 t1{n};
  333. signed __int128 t2{n};
  334. UNIT_ASSERT(IsIdentical(t1, t2));
  335. }
  336. }
  337. Y_UNIT_TEST_SUITE(i128_And_ui16_BitwiseIdentity) {
  338. Y_UNIT_TEST(i128_from_ui16_Zero) {
  339. ui16 n = 0;
  340. i128 t1{n};
  341. signed __int128 t2{n};
  342. UNIT_ASSERT(IsIdentical(t1, t2));
  343. }
  344. Y_UNIT_TEST(i128_from_ui16_Plus1) {
  345. ui16 n = 1;
  346. i128 t1{n};
  347. signed __int128 t2{n};
  348. UNIT_ASSERT(IsIdentical(t1, t2));
  349. }
  350. Y_UNIT_TEST(i128_from_ui16_Plus42) {
  351. ui16 n = 42;
  352. i128 t1{n};
  353. signed __int128 t2{n};
  354. UNIT_ASSERT(IsIdentical(t1, t2));
  355. }
  356. Y_UNIT_TEST(i128_from_ui16_Min) {
  357. ui16 n = std::numeric_limits<i8>::min();
  358. i128 t1{n};
  359. signed __int128 t2{n};
  360. UNIT_ASSERT(IsIdentical(t1, t2));
  361. }
  362. Y_UNIT_TEST(i128_from_ui16_Max) {
  363. ui16 n = std::numeric_limits<i8>::max();
  364. i128 t1{n};
  365. signed __int128 t2{n};
  366. UNIT_ASSERT(IsIdentical(t1, t2));
  367. }
  368. Y_UNIT_TEST(i128_from_ui16_MinPlus1) {
  369. ui16 n = std::numeric_limits<i8>::min() + 1;
  370. i128 t1{n};
  371. signed __int128 t2{n};
  372. UNIT_ASSERT(IsIdentical(t1, t2));
  373. }
  374. Y_UNIT_TEST(i128_from_ui16_MaxMinus1) {
  375. ui16 n = std::numeric_limits<i8>::max() - 1;
  376. i128 t1{n};
  377. signed __int128 t2{n};
  378. UNIT_ASSERT(IsIdentical(t1, t2));
  379. }
  380. }
  381. Y_UNIT_TEST_SUITE(i128_And_ui32_BitwiseIdentity) {
  382. Y_UNIT_TEST(i128_from_ui32_Zero) {
  383. ui32 n = 0;
  384. i128 t1{n};
  385. signed __int128 t2{n};
  386. UNIT_ASSERT(IsIdentical(t1, t2));
  387. }
  388. Y_UNIT_TEST(i128_from_ui32_Plus1) {
  389. ui32 n = 1;
  390. i128 t1{n};
  391. signed __int128 t2{n};
  392. UNIT_ASSERT(IsIdentical(t1, t2));
  393. }
  394. Y_UNIT_TEST(i128_from_ui32_Plus42) {
  395. ui32 n = 42;
  396. i128 t1{n};
  397. signed __int128 t2{n};
  398. UNIT_ASSERT(IsIdentical(t1, t2));
  399. }
  400. Y_UNIT_TEST(i128_from_ui32_Min) {
  401. ui32 n = std::numeric_limits<i8>::min();
  402. i128 t1{n};
  403. signed __int128 t2{n};
  404. UNIT_ASSERT(IsIdentical(t1, t2));
  405. }
  406. Y_UNIT_TEST(i128_from_ui32_Max) {
  407. ui32 n = std::numeric_limits<i8>::max();
  408. i128 t1{n};
  409. signed __int128 t2{n};
  410. UNIT_ASSERT(IsIdentical(t1, t2));
  411. }
  412. Y_UNIT_TEST(i128_from_ui32_MinPlus1) {
  413. ui32 n = std::numeric_limits<i8>::min() + 1;
  414. i128 t1{n};
  415. signed __int128 t2{n};
  416. UNIT_ASSERT(IsIdentical(t1, t2));
  417. }
  418. Y_UNIT_TEST(i128_from_ui32_MaxMinus1) {
  419. ui32 n = std::numeric_limits<i8>::max() - 1;
  420. i128 t1{n};
  421. signed __int128 t2{n};
  422. UNIT_ASSERT(IsIdentical(t1, t2));
  423. }
  424. }
  425. Y_UNIT_TEST_SUITE(i128_And_ui64_BitwiseIdentity) {
  426. Y_UNIT_TEST(i128_from_ui64_Zero) {
  427. ui64 n = 0;
  428. i128 t1{n};
  429. signed __int128 t2{n};
  430. UNIT_ASSERT(IsIdentical(t1, t2));
  431. }
  432. Y_UNIT_TEST(i128_from_ui64_Plus1) {
  433. ui64 n = 1;
  434. i128 t1{n};
  435. signed __int128 t2{n};
  436. UNIT_ASSERT(IsIdentical(t1, t2));
  437. }
  438. Y_UNIT_TEST(i128_from_ui64_Plus42) {
  439. ui64 n = 42;
  440. i128 t1{n};
  441. signed __int128 t2{n};
  442. UNIT_ASSERT(IsIdentical(t1, t2));
  443. }
  444. Y_UNIT_TEST(i128_from_ui64_Min) {
  445. ui64 n = std::numeric_limits<i8>::min();
  446. i128 t1{n};
  447. signed __int128 t2{n};
  448. UNIT_ASSERT(IsIdentical(t1, t2));
  449. }
  450. Y_UNIT_TEST(i128_from_ui64_Max) {
  451. ui64 n = std::numeric_limits<i8>::max();
  452. i128 t1{n};
  453. signed __int128 t2{n};
  454. UNIT_ASSERT(IsIdentical(t1, t2));
  455. }
  456. Y_UNIT_TEST(i128_from_ui64_MinPlus1) {
  457. ui64 n = std::numeric_limits<i8>::min() + 1;
  458. i128 t1{n};
  459. signed __int128 t2{n};
  460. UNIT_ASSERT(IsIdentical(t1, t2));
  461. }
  462. Y_UNIT_TEST(i128_from_ui64_MaxMinus1) {
  463. ui64 n = std::numeric_limits<i8>::max() - 1;
  464. i128 t1{n};
  465. signed __int128 t2{n};
  466. UNIT_ASSERT(IsIdentical(t1, t2));
  467. }
  468. }
  469. Y_UNIT_TEST_SUITE(i128_And_unsigned_int128_BitwiseIdentity) {
  470. Y_UNIT_TEST(i128_from_unsigned_int128_Zero) {
  471. unsigned __int128 n = 0;
  472. i128 t1{n};
  473. signed __int128 t2 = static_cast<signed __int128>(n);
  474. UNIT_ASSERT(IsIdentical(t1, t2));
  475. }
  476. Y_UNIT_TEST(i128_from_unsigned_int128_Plus1) {
  477. unsigned __int128 n = 1;
  478. i128 t1{n};
  479. signed __int128 t2 = static_cast<signed __int128>(n);
  480. UNIT_ASSERT(IsIdentical(t1, t2));
  481. }
  482. Y_UNIT_TEST(i128_from_unsigned_int128_Plus42) {
  483. unsigned __int128 n = 42;
  484. i128 t1{n};
  485. signed __int128 t2 = static_cast<signed __int128>(n);
  486. UNIT_ASSERT(IsIdentical(t1, t2));
  487. }
  488. Y_UNIT_TEST(i128_from_unsigned_int128_Min) {
  489. unsigned __int128 n = std::numeric_limits<i8>::min();
  490. i128 t1{n};
  491. signed __int128 t2 = static_cast<signed __int128>(n);
  492. UNIT_ASSERT(IsIdentical(t1, t2));
  493. }
  494. Y_UNIT_TEST(i128_from_unsigned_int128_Max) {
  495. unsigned __int128 n = std::numeric_limits<i8>::max();
  496. i128 t1{n};
  497. signed __int128 t2 = static_cast<signed __int128>(n);
  498. UNIT_ASSERT(IsIdentical(t1, t2));
  499. }
  500. Y_UNIT_TEST(i128_from_unsigned_int128_MinPlus1) {
  501. unsigned __int128 n = std::numeric_limits<i8>::min() + 1;
  502. i128 t1{n};
  503. signed __int128 t2 = static_cast<signed __int128>(n);
  504. UNIT_ASSERT(IsIdentical(t1, t2));
  505. }
  506. Y_UNIT_TEST(i128_from_unsigned_int128_MaxMinus1) {
  507. unsigned __int128 n = std::numeric_limits<i8>::max() - 1;
  508. i128 t1{n};
  509. signed __int128 t2 = static_cast<signed __int128>(n);
  510. UNIT_ASSERT(IsIdentical(t1, t2));
  511. }
  512. }
  513. #endif