1/* PR tree-optimization/19828 */ 2typedef __SIZE_TYPE__ size_t; 3extern size_t strlen (const char *s); 4extern int strncmp (const char *s1, const char *s2, size_t n); 5extern void abort (void); 6 7const char *a[16] = { "a", "bc", "de", "fgh" }; 8 9int 10foo (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 24int 25main (void) 26{ 27 if (foo ("abcde", (const char *) 0, 3) != 0) 28 abort (); 29 return 0; 30} 31