struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-p18298.c
blob66d79f80e328004f057ac6fa75affb886ca099d3
1 /*
2 p18298.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* { dg-options "-fgnu89-inline" } */
9 #include <stdbool.h>
10 #include <stdlib.h>
12 #if !(defined(__SDCC_mcs51) && (defined(__SDCC_MODEL_SMALL) || defined(__SDCC_MODEL_MEDIUM))) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) && !defined(__SDCC_pic14) // Lack of memory
13 extern bool foo(const char *str); // extern declaration required by C standard, not present in GCC original, added to pass hosts regression tests everywhere.
15 int strcmp (const char*, const char*);
16 char s[2048] = "a";
17 inline bool foo(const char *str) {
18 return !strcmp(s,str);
20 #endif
21 void
22 testTortureExecute (void) {
23 #if !(defined(__SDCC_mcs51) && (defined(__SDCC_MODEL_SMALL) || defined(__SDCC_MODEL_MEDIUM))) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) && !defined(__SDCC_pic14) // Lack of memory
24 int i = 0;
25 while(!(foo(""))) {
26 i ++;
27 s[0] = '\0';
28 if (i>2)
29 ASSERT (0);
31 #endif
32 return;