/* * smoke.c — end-to-end smoke test. * * Linked with crt0.o + libc.a, -nostdlib -static: if this binary runs at * all, the whole chain works — entry point, main(), our string code, and * raw syscalls — with no dynamic linker and no glibc in the process. */ #include #include int main(void) { static const char msg[] = "nulsl-libc smoke test: ok\n"; if (strcmp("abc", "abc") != 0) return 1; if (strcmp("abc", "abd") == 0) return 2; if (strncmp("abcdef", "abcxyz", 3) != 0) return 3; if (strlen("nulsl") != 5) return 4; if (memcmp("abcd", "abce", 3) != 0) return 5; if (write(STDOUT_FILENO, msg, sizeof msg - 1) < 0) return 6; return 0; }