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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr35258.c] - Rev 750

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

/* { dg-do run } */
/* { dg-options "-O1" } */
 
extern void *memcpy (void *, const void *, __SIZE_TYPE__);
extern int memcmp (const void *, const void *, __SIZE_TYPE__);
extern void abort(void);
 
char str[9] = "1234";
 
void
bar (void)
{
  unsigned int temp;
  char *p = &str[2];
 
  memcpy (&temp, &str[1], 4);
  memcpy (p, &temp, 4);
  str[1] = '.';
}
 
int main()
{
  bar();
  if (memcmp (str, "1.234", 5) != 0)
    abort ();
 
  return 0;
}
 

Go to most recent revision | 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.