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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.target/] [i386/] [pr20204.c] - Rev 816

Compare with Previous | Blame | View Log

/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O2" } */
 
void *x (void *pdst, const void *psrc, unsigned int pn)
{
  register void *return_dst = pdst;
  register unsigned char *dst = pdst;
  register unsigned const char *src = psrc;
  register int n __asm__ ("ebx") = pn;
 
  if (src < dst && dst < src + n)
    {
      src += n;
      dst += n;
      while (n--)
        *--dst = *--src;
      return return_dst;
    }
 
  while (n >= 16) n--;
 
  return return_dst;
}
extern void abort ();
extern void exit (int);
char xx[30] = "abc";
int main (void)
{
  char yy[30] = "aab";
 
  if (x (xx + 1, xx, 2) != xx + 1 || memcmp (xx, yy, sizeof (yy)) != 0)
    abort ();
  exit (0);
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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