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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [pr35258.c] - Blame information for rev 316

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

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O1" } */
3
 
4
extern void *memcpy (void *, const void *, __SIZE_TYPE__);
5
extern int memcmp (const void *, const void *, __SIZE_TYPE__);
6
extern void abort(void);
7
 
8
char str[9] = "1234";
9
 
10
void
11
bar (void)
12
{
13
  unsigned int temp;
14
  char *p = &str[2];
15
 
16
  memcpy (&temp, &str[1], 4);
17
  memcpy (p, &temp, 4);
18
  str[1] = '.';
19
}
20
 
21
int main()
22
{
23
  bar();
24
  if (memcmp (str, "1.234", 5) != 0)
25
    abort ();
26
 
27
  return 0;
28
}

powered by: WebSVN 2.1.0

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