diff -Naurp dietlibc-0.32-20080509/test/Makefile dietlibc-0.32-20080509.oden/test/Makefile --- dietlibc-0.32-20080509/test/Makefile 2008-06-08 12:50:43.000000000 -0400 +++ dietlibc-0.32-20080509.oden/test/Makefile 2008-06-08 12:50:25.000000000 -0400 @@ -14,7 +14,7 @@ glob grent hasmntopt hello iconv if_name memccpy memcpy memchr memcmp memrchr memusage mktime mmap_test pipe printf printftest \ protoent prototypes putenv pwent rand48 read1 readdir regex select sendfile servent siglist \ speed spent sprintf sscanf stdarg strcasecmp strcmp strncat strncpy strptime strrchr \ -strstr strtol sysenter ungetc utime waitpid +strstr strtol strncmp sysenter ungetc utime waitpid test: $(TESTPROGRAMS) @@ -49,6 +49,10 @@ timetests: $(MAKE) -C time CC="$(CC)" CFLAGS="$(CFLAGS)" DIET=$(DIET) LCOMPAT=$(LCOMPAT) +str%: str%.c + $(DIET) $(CC) $(CFLAGS) -fno-builtin $^ -o $@ +mem%: mem%.c + $(DIET) $(CC) $(CFLAGS) -fno-builtin $^ -o $@ %: %.c $(DIET) $(CC) $(CFLAGS) $^ -o $@ diff -Naurp dietlibc-0.32-20080509/test/strncmp.c dietlibc-0.32-20080509.oden/test/strncmp.c --- dietlibc-0.32-20080509/test/strncmp.c 1969-12-31 19:00:00.000000000 -0500 +++ dietlibc-0.32-20080509.oden/test/strncmp.c 2008-06-08 12:49:28.000000000 -0400 @@ -0,0 +1,27 @@ +#include <stdlib.h> +#include <string.h> +#include <limits.h> + +int main(void) +{ + const char foo[] = "foo"; + + if (strncmp(foo, "bar", 3) == 0) + abort(); + if (strncmp(foo, "foo", 3) != 0) + abort(); + if (strncmp(foo, "", (size_t)-1) == 0) + abort(); + if (strncmp(foo, "fo", 3) == 0) + abort(); + if (strncmp(foo, "fo", 2) != 0) + abort(); + if (strncmp(foo, "fo", 10) <= 0) + abort(); + if (strncmp(foo, "fo", ULONG_MAX) <= 0) + abort(); + if (strncmp(foo, "fo", (size_t)-1) <= 0) + abort(); + + return 0; +}