aboutsummaryrefslogtreecommitdiffstats
path: root/libj2_j2u_rsh.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-12-06 10:21:36 +0100
committerMattias Andrée <m@maandree.se>2025-12-06 10:21:36 +0100
commitc28859c3e10c84fd9f81ebf88336c9b693448eeb (patch)
tree22f9804f4ba96474c23c93c021d293ba5959ccfa /libj2_j2u_rsh.c
parentSecond commit (diff)
downloadlibj2-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_rsh.c')
-rw-r--r--libj2_j2u_rsh.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libj2_j2u_rsh.c b/libj2_j2u_rsh.c
index 2a5ed50..3dc18e9 100644
--- a/libj2_j2u_rsh.c
+++ b/libj2_j2u_rsh.c
@@ -84,6 +84,10 @@ check(const char *pattern)
EXPECT(libj2_j2u_rsh_underflow(&r, i) == underflows);
EXPECT(libj2_j2u_eq_j2u(&r, &expected));
+ r = a;
+ EXPECT(libj2_j2u_rsh_underflow_p((const struct libj2_j2u *)&r, i) == underflows);
+ EXPECT(libj2_j2u_eq_j2u(&r, &a));
+
r = (struct libj2_j2u){111, 222};
libj2_j2u_rsh_to_j2u(&a, i, &r);
EXPECT(libj2_j2u_eq_j2u(&a, &a_saved));