mirror of
https://github.com/nArnoSNES/tcc-65816.git
synced 2024-06-11 22:29:28 +00:00
31 lines
585 B
C
31 lines
585 B
C
/* PR tree-optimization/19828 */
|
|
typedef __SIZE_TYPE__ size_t;
|
|
extern size_t strlen (const char *s);
|
|
extern int strncmp (const char *s1, const char *s2, size_t n);
|
|
extern void abort (void);
|
|
|
|
const char *a[16] = { "a", "bc", "de", "fgh" };
|
|
|
|
int
|
|
foo (char *x, const char *y, size_t n)
|
|
{
|
|
size_t i, j = 0;
|
|
for (i = 0; i < n; i++)
|
|
{
|
|
if (strncmp (x + j, a[i], strlen (a[i])) != 0)
|
|
return 2;
|
|
j += strlen (a[i]);
|
|
if (y)
|
|
j += strlen (y);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
if (foo ("abcde", (const char *) 0, 3) != 0)
|
|
abort ();
|
|
return 0;
|
|
}
|