Reset branch to trunk.
[official-gcc.git] / trunk / gcc / testsuite / gcc.c-torture / execute / builtins / lib / memset.c
blob90545abbf24eda4f750d50a8e2b55a66b8afd03d
1 extern void abort (void);
2 extern int inside_main;
4 __attribute__ ((__noinline__))
5 void *
6 memset (void *dst, int c, __SIZE_TYPE__ n)
8 while (n-- != 0)
9 n[(char *) dst] = c;
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
19 return dst;