diff options
| author | Mattias Andrée <m@maandree.se> | 2025-12-06 10:21:36 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2025-12-06 10:21:36 +0100 |
| commit | c28859c3e10c84fd9f81ebf88336c9b693448eeb (patch) | |
| tree | 22f9804f4ba96474c23c93c021d293ba5959ccfa /libj2_j2u_lsh.c | |
| parent | Second commit (diff) | |
| download | libj2-c28859c3e10c84fd9f81ebf88336c9b693448eeb.tar.gz libj2-c28859c3e10c84fd9f81ebf88336c9b693448eeb.tar.bz2 libj2-c28859c3e10c84fd9f81ebf88336c9b693448eeb.tar.xz | |
Add overflow and underflow prediction functions
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libj2_j2u_lsh.c')
| -rw-r--r-- | libj2_j2u_lsh.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libj2_j2u_lsh.c b/libj2_j2u_lsh.c index 85ca72b..914c3b2 100644 --- a/libj2_j2u_lsh.c +++ b/libj2_j2u_lsh.c @@ -126,6 +126,10 @@ check(const char *pattern) EXPECT(libj2_j2u_lsh_overflow(&r, i) == overflows); EXPECT(libj2_j2u_eq_j2u(&r, &expected)); + r = a; + EXPECT(libj2_j2u_lsh_overflow_p((const struct libj2_j2u *)&r, i) == overflows); + EXPECT(libj2_j2u_eq_j2u(&r, &a)); + r = (struct libj2_j2u){111, 222}; libj2_j2u_lsh_to_j2u(&a, i, &r); EXPECT(libj2_j2u_eq_j2u(&r, &expected)); |
