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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20050218-1.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
/* PR tree-optimization/19828 */
2
typedef __SIZE_TYPE__ size_t;
3
extern size_t strlen (const char *s);
4
extern int strncmp (const char *s1, const char *s2, size_t n);
5
extern void abort (void);
6
 
7
const char *a[16] = { "a", "bc", "de", "fgh" };
8
 
9
int
10
foo (char *x, const char *y, size_t n)
11
{
12
  size_t i, j = 0;
13
  for (i = 0; i < n; i++)
14
    {
15
      if (strncmp (x + j, a[i], strlen (a[i])) != 0)
16
        return 2;
17
      j += strlen (a[i]);
18
      if (y)
19
        j += strlen (y);
20
    }
21
  return 0;
22
}
23
 
24
int
25
main (void)
26
{
27
  if (foo ("abcde", (const char *) 0, 3) != 0)
28
    abort ();
29
  return 0;
30
}

powered by: WebSVN 2.1.0

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