Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/gcc.dg/strlenopt.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line diff
--- a/gcc/testsuite/gcc.dg/strlenopt.h Thu Oct 25 07:37:49 2018 +0900 +++ b/gcc/testsuite/gcc.dg/strlenopt.h Thu Feb 13 11:34:05 2020 +0900 @@ -1,10 +1,11 @@ -/* This is a replacement of needed parts from stdlib.h and string.h +/* This is a replacement of needed parts from <stdlib.h> and <string.h> for -foptimize-strlen testing, to ensure we are testing the builtins rather than whatever the OS has in its headers. */ #define NULL ((void *) 0) typedef __SIZE_TYPE__ size_t; extern void abort (void); +void *calloc (size_t, size_t); void *malloc (size_t); void free (void *); char *strdup (const char *); @@ -15,6 +16,8 @@ char *strcpy (char *__restrict, const char *__restrict); char *strcat (char *__restrict, const char *__restrict); char *strchr (const char *, int); +int strcmp (const char *, const char *); +int strncmp (const char *, const char *, size_t); void *memset (void *, int, size_t); int memcmp (const void *, const void *, size_t); int strcmp (const char *, const char *); @@ -23,6 +26,9 @@ char *stpcpy (char *__restrict, const char *__restrict); #endif +int sprintf (char * __restrict, const char *__restrict, ...); +int snprintf (char * __restrict, size_t, const char *__restrict, ...); + #if defined(FORTIFY_SOURCE) && FORTIFY_SOURCE > 0 && __OPTIMIZE__ # define bos(ptr) __builtin_object_size (ptr, FORTIFY_SOURCE > 0) # define bos0(ptr) __builtin_object_size (ptr, 0)