tools/nolibc: add tests for the integer limits in stdint.h
authorVincent Dagonneau <v@vda.io>
Sat, 4 Mar 2023 14:26:06 +0000 (15:26 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 20 Mar 2023 15:45:22 +0000 (08:45 -0700)
commitd1209597ff00b6a3c80e37089f7139d0774034bd
treefd06ca0a67cd1247037b301ca1cb280890f22835
parenta0994fb98d70f99a0f93feb44d1401071381c056
tools/nolibc: add tests for the integer limits in stdint.h

This commit adds tests for the limits added in a previous commit. The
limits are defined in decimal in stdint.h and as hexadecimal in the
tests (e.g. 0x7f = 127 or 0x80 = -128). Hopefully it catches some of the
most egregious mistakes.

As we rely on the compiler to provide __SIZEOF_LONG__, we also test
whether it is defined.

Signed-off-by: Vincent Dagonneau <v@vda.io>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/testing/selftests/nolibc/nolibc-test.c