Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-961125-1.c
blob9a62a1175ed63ee9a78757aa7ace4e1480ead369
1 /*
2 961125-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #pragma disable_warning 196
10 #endif
12 static char *
13 begfield (int tab, char *ptr, char *lim, int sword, int schar)
15 if (tab)
17 while (ptr < lim && sword--)
19 while (ptr < lim && *ptr != tab)
20 ++ptr;
21 if (ptr < lim)
22 ++ptr;
25 else
27 while (1)
31 if (ptr + schar <= lim)
32 ptr += schar;
34 return ptr;
37 void
38 testTortureExecute (void)
40 char *s = ":ab";
41 char *lim = s + 3;
42 if (begfield (':', s, lim, 1, 1) != s + 2)
43 ASSERT (0);
44 return;