struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20050218-1.c
blob33b6dd64f3d7b19e126f5338f150a713bf791a49
1 /*
2 20050218-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 #include <string.h>
13 #if !defined(__SDCC_pdk14) // Lack of memory
15 /* PR tree-optimization/19828 */
17 const char *a[16] = { "a", "bc", "de", "fgh" };
19 int
20 foo (char *x, const char *y, size_t n)
22 size_t i, j = 0;
23 for (i = 0; i < n; i++)
25 if (strncmp (x + j, a[i], strlen (a[i])) != 0)
26 return 2;
27 j += strlen (a[i]);
28 if (y)
29 j += strlen (y);
31 return 0;
33 #endif
35 void
36 testTortureExecute (void)
38 #if !defined(__SDCC_pdk14) // Lack of memory
39 if (foo ("abcde", (const char *) 0, 3) != 0)
40 ASSERT (0);
41 return;
42 #endif