diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-03-20 17:59:56 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-03-20 17:59:56 +0100 |
| commit | 77de9119efbee9e65f0b50fc8b9315b6fb0910fb (patch) | |
| tree | 17a335925106f44e6b3178c8c61beba583d3b42d /test | |
| parent | d16656919753438a57a32f9ad6ba972c25d66b11 (diff) | |
| download | zmodn-master.tar.gz zmodn-master.zip | |
Diffstat (limited to '')
| -rwxr-xr-x | test | 18 |
1 files changed, 18 insertions, 0 deletions
| @@ -12,6 +12,10 @@ exit 0 | |||
| 12 | #include "zmodn.h" | 12 | #include "zmodn.h" |
| 13 | #include "bigint.h" | 13 | #include "bigint.h" |
| 14 | 14 | ||
| 15 | #if defined(__clang__) && __clang_major__ >= 16 | ||
| 16 | #include "bitint_wrapper.h" | ||
| 17 | #endif | ||
| 18 | |||
| 15 | #include <concepts> | 19 | #include <concepts> |
| 16 | #include <functional> | 20 | #include <functional> |
| 17 | #include <iostream> | 21 | #include <iostream> |
| @@ -479,6 +483,20 @@ public: | |||
| 479 | assert_equal(inv.value().toint(), expected); | 483 | assert_equal(inv.value().toint(), expected); |
| 480 | } | 484 | } |
| 481 | }, | 485 | }, |
| 486 | #if defined(__clang__) && __clang_major__ >= 16 | ||
| 487 | { | ||
| 488 | .name = "Zmod with BitInt", | ||
| 489 | .f = []() { | ||
| 490 | constexpr BitInt N{1000000000000LL}; // 1e12 | ||
| 491 | BitInt a{600000000000LL}; // 6e11 | ||
| 492 | BitInt b{700000000000LL}; // 7e11 | ||
| 493 | BitInt c{300000000000LL}; // 3e11 | ||
| 494 | |||
| 495 | Zmod<N> a_modN(a), b_modN(b), c_modN(c); | ||
| 496 | assert_equal(a_modN + b_modN, c_modN); | ||
| 497 | } | ||
| 498 | }, | ||
| 499 | #endif | ||
| 482 | /* | 500 | /* |
| 483 | { | 501 | { |
| 484 | .name = "This does not compile", | 502 | .name = "This does not compile", |
