modernc.org/cc@v1.0.1/testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/builtins/lib/memset.c (about) 1 extern void abort (void); 2 extern int inside_main; 3 4 __attribute__ ((__noinline__)) 5 void * 6 memset (void *dst, int c, __SIZE_TYPE__ n) 7 { 8 while (n-- != 0) 9 n[(char *) dst] = c; 10 11 /* Single-byte memsets should be done inline when optimisation 12 is enabled. Do this after the copy in case we're being called to 13 initialize bss. */ 14 #ifdef __OPTIMIZE__ 15 if (inside_main && n < 2) 16 abort (); 17 #endif 18 19 return dst; 20 }