OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [builtins/] [lib/] [memcmp.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.