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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20011024-1.c] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
/* Test whether store motion recognizes pure functions as potentially reading
/* Test whether store motion recognizes pure functions as potentially reading
   any memory.  */
   any memory.  */
 
 
typedef __SIZE_TYPE__ size_t;
typedef __SIZE_TYPE__ size_t;
extern void *memcpy (void *dest, const void *src, size_t n);
extern void *memcpy (void *dest, const void *src, size_t n);
extern size_t strlen (const char *s);
extern size_t strlen (const char *s);
extern int strcmp (const char *s1, const char *s2) __attribute__((pure));
extern int strcmp (const char *s1, const char *s2) __attribute__((pure));
 
 
char buf[50];
char buf[50];
 
 
static void foo (void)
static void foo (void)
{
{
  if (memcpy (buf, "abc", 4) != buf) abort ();
  if (memcpy (buf, "abc", 4) != buf) abort ();
  if (strcmp (buf, "abc")) abort ();
  if (strcmp (buf, "abc")) abort ();
  memcpy (buf, "abcdefgh", strlen ("abcdefgh") + 1);
  memcpy (buf, "abcdefgh", strlen ("abcdefgh") + 1);
}
}
 
 
int main (void)
int main (void)
{
{
  foo ();
  foo ();
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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