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] - Blame information for rev 825

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
2
/* { dg-options "-O2" } */
3
 
4
void *x (void *pdst, const void *psrc, unsigned int pn)
5
{
6
  register void *return_dst = pdst;
7
  register unsigned char *dst = pdst;
8
  register unsigned const char *src = psrc;
9
  register int n __asm__ ("ebx") = pn;
10
 
11
  if (src < dst && dst < src + n)
12
    {
13
      src += n;
14
      dst += n;
15
      while (n--)
16
        *--dst = *--src;
17
      return return_dst;
18
    }
19
 
20
  while (n >= 16) n--;
21
 
22
  return return_dst;
23
}
24
extern void abort ();
25
extern void exit (int);
26
char xx[30] = "abc";
27
int main (void)
28
{
29
  char yy[30] = "aab";
30
 
31
  if (x (xx + 1, xx, 2) != xx + 1 || memcmp (xx, yy, sizeof (yy)) != 0)
32
    abort ();
33
  exit (0);
34
}

powered by: WebSVN 2.1.0

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