Merging upstream version 0.7.1 (Closes: #991419).

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 07:39:31 +01:00
parent 05c588e9d7
commit 9e09e0ef69
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
99 changed files with 6727 additions and 943 deletions

View file

@ -0,0 +1,17 @@
.PHONY: check clean distribution
OBJECTS=ck_cc
all: $(OBJECTS)
ck_cc: ck_cc.c ../../../include/ck_cc.h
$(CC) $(CFLAGS) -g2 -o ck_cc ck_cc.c
check: all
./ck_cc
clean:
rm -rf *~ *.o $(OBJECTS) *.dSYM *.exe
include ../../../build/regressions.build
CFLAGS+=-D_GNU_SOURCE

View file

@ -0,0 +1,37 @@
#include <ck_pr.h>
#include <limits.h>
#include <stdio.h>
#include "../../common.h"
int
main(void)
{
unsigned int x;
ck_pr_store_uint(&x, 0x10110);
if (ck_cc_ffs(0) != 0)
ck_error("ffs(0) = %d\n", ck_cc_ffs(0));
if (ck_cc_ffs(4) != 3)
ck_error("ffs(4) = %d\n", ck_cc_ffs(4));
if (ck_cc_ffs(UINT_MAX) != 1)
ck_error("ffs(UINT_MAX) = %d\n", ck_cc_ffs(UINT_MAX));
if (ck_cc_ffs(x) != 5)
ck_error("ffs(%u) = %d\n", x, ck_cc_ffs(x));
if (ck_cc_ffs(x) != ck_cc_ffsl(x) ||
ck_cc_ffsl(x) != ck_cc_ffsll(x) ||
ck_cc_ffs(x) != ck_cc_ffsll(x)) {
ck_error(" ffs = %d, ffsl = %d, ffsll = %d\n",
ck_cc_ffs(x), ck_cc_ffsl(x), ck_cc_ffsll(x));
}
if (ck_cc_ctz(x) != 4)
ck_error("ctz = %d\n", ck_cc_ctz(x));
if (ck_cc_popcount(x) != 3)
ck_error("popcount = %d\n", ck_cc_popcount(x));
return 0;
}