(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.c-torture/
execute/
builtins/
lib/
memcmp.c
       1  extern void abort(void);
       2  extern int inside_main;
       3  
       4  __attribute__ ((__noinline__))
       5  int
       6  memcmp (const void *s1, const void *s2, __SIZE_TYPE__ len)
       7  {
       8    const unsigned char *sp1, *sp2;
       9  
      10  #ifdef __OPTIMIZE__
      11    if (inside_main)
      12      abort ();
      13  #endif
      14  
      15    sp1 = s1;
      16    sp2 = s2;
      17    while (len != 0 && *sp1 == *sp2)
      18      sp1++, sp2++, len--;
      19  
      20    if (len == 0)
      21      return 0;
      22    return *sp1 - *sp2;
      23  }