/* SPDX-License-Identifier: GPL-2.0 */#define _GNU_SOURCE#define _LARGEFILE64_SOURCE/* libc-specific include files * The program may be built in 3 ways: * $(CC) -nostdlib -include /path/to/nolibc.h => NOLIBC already defined * $(CC) -nostdlib -I/path/to/nolibc/sysroot => _NOLIBC_* guards are present * $(CC) with default libc => NOLIBC* never defined */#ifndef NOLIBC#include<stdio.h>#include<stdlib.h>#include<string.h>#ifndef _NOLIBC_STDIO_H/* standard libcs need more includes */#include<sys/auxv.h>#include<sys/io.h>#include<sys/ioctl.h>#include<sys/mman.h>#include<sys/mount.h>#include<sys/prctl.h>#include<sys/reboot.h>#include<sys/resource.h>#include<sys/stat.h>#include<sys/syscall.h>#include<sys/sysmacros.h>#include<sys/time.h>#include<sys/wait.h>#include<dirent.h>#include<errno.h>#include<fcntl.h>#include<poll.h>#include<sched.h>#include<signal.h>#include<stdarg.h>#include<stddef.h>#include<stdint.h>#include<unistd.h>#include<limits.h>#endif#endif#include"nolibc-test-linkage.h"/* for the type of int_fast16_t and int_fast32_t, musl differs from glibc and nolibc */#define SINT_MAX_OF_TYPE(type) (((type)1 << (sizeof(type) * 8 - 2)) - (type)1 + ((type)1 << (sizeof(type) * 8 - 2)))#define SINT_MIN_OF_TYPE(type) (-SINT_MAX_OF_TYPE(type) - 1)/* will be used to test initialization of environ */staticchar**test_envp;/* will be used to test initialization of argv */staticchar**test_argv;/* will be used to test initialization of argc */staticinttest_argc;/* will be used by some test cases as readable file, please don't write it */staticconstchar*argv0;/* will be used by constructor tests */staticintconstructor_test_value;/* definition of a series of tests */structtest{constchar*name;/* test name */int(*func)(intmin,intmax);/* handler */};#ifndef _NOLIBC_STDLIB_Hchar*itoa(inti){<