summaryrefslogtreecommitdiffstats
path: root/tests/bit.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-11-11 13:46:21 -0500
committerTavian Barnes <tavianator@tavianator.com>2023-11-11 13:47:00 -0500
commit56e35928daaec12c97ccc4707546f669db1d909d (patch)
tree9db552bd2e1f69a96dfaaee4c215b0ed4f87b4f0 /tests/bit.c
parent640fa83406bb8c08d971be68b32b7e222e92e286 (diff)
downloadbfs-56e35928daaec12c97ccc4707546f669db1d909d.tar.xz
Revert "bit: Implement a branchless has_single_bit()"
Doesn't work for the highest bit due to overflow. This reverts commit 208376ef99da243545efcd6fb02d3469b4c068ed.
Diffstat (limited to 'tests/bit.c')
-rw-r--r--tests/bit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/bit.c b/tests/bit.c
index 7b20770..f9071be 100644
--- a/tests/bit.c
+++ b/tests/bit.c
@@ -119,6 +119,7 @@ int main(void) {
bfs_verify(!has_single_bit(0));
bfs_verify(!has_single_bit(UINT32_MAX));
+ bfs_verify(has_single_bit((uint32_t)1 << (UINT_WIDTH - 1)));
return EXIT_SUCCESS;
}