From 77de9119efbee9e65f0b50fc8b9315b6fb0910fb Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 20 Mar 2026 17:59:56 +0100 Subject: Added support for _BitInt (available in clang) --- test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test') diff --git a/test b/test index 46ed7c3..2657439 100755 --- a/test +++ b/test @@ -12,6 +12,10 @@ exit 0 #include "zmodn.h" #include "bigint.h" +#if defined(__clang__) && __clang_major__ >= 16 +#include "bitint_wrapper.h" +#endif + #include #include #include @@ -479,6 +483,20 @@ public: assert_equal(inv.value().toint(), expected); } }, +#if defined(__clang__) && __clang_major__ >= 16 +{ + .name = "Zmod with BitInt", + .f = []() { + constexpr BitInt N{1000000000000LL}; // 1e12 + BitInt a{600000000000LL}; // 6e11 + BitInt b{700000000000LL}; // 7e11 + BitInt c{300000000000LL}; // 3e11 + + Zmod a_modN(a), b_modN(b), c_modN(c); + assert_equal(a_modN + b_modN, c_modN); + } +}, +#endif /* { .name = "This does not compile", -- cgit v1.3