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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20050502-2.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 688 jeremybenn
/* PR target/21297 */
2
typedef __SIZE_TYPE__ size_t;
3
extern int memcmp (const char *, const char *, size_t);
4
extern void abort ();
5
 
6
void
7
foo (char *x)
8
{
9
  int i;
10
  for (i = 0; i < 2; i++);
11
  x[i + i] = '\0';
12
}
13
 
14
void
15
bar (char *x)
16
{
17
  int i;
18
  for (i = 0; i < 2; i++);
19
  x[i + i + i + i] = '\0';
20
}
21
 
22
int
23
main (void)
24
{
25
  char x[] = "IJKLMNOPQR";
26
  foo (x);
27
  if (memcmp (x, "IJKL\0NOPQR", sizeof x) != 0)
28
    abort ();
29
  x[4] = 'M';
30
  bar (x);
31
  if (memcmp (x, "IJKLMNOP\0R", sizeof x) != 0)
32
    abort ();
33
  return 0;
34
}

powered by: WebSVN 2.1.0

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