struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20031012-1.c
blob5dbd2b1347b6491851e66fb8040039adba60a813
1 /*
2 20031012-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 /* PR optimization/8750
12 Used to fail under Cygwin with
13 -O2 -fomit-frame-pointer
14 Testcase by David B. Trout */
16 #if defined(STACK_SIZE) && STACK_SIZE < 16000
17 #define ARRAY_SIZE (STACK_SIZE / 2)
18 #define STRLEN (ARRAY_SIZE - 9)
19 #else
20 #define ARRAY_SIZE 15000
21 #define STRLEN 13371
22 #endif
24 #include <string.h>
26 static void foo ()
28 #if !defined (__SDCC_sm83) && !defined (__SDCC_mcs51) && !defined (__SDCC_stm8) && !defined (__SDCC_pdk14) && !defined (__SDCC_pdk15) && !defined (__SDCC_f8)
29 char a[ARRAY_SIZE]; /* Too big for mcs51 and gbz80 and stm8 and pdk14. */
30 a[0]=0;
31 memset( &a[0], 0xCD, STRLEN );
32 a[STRLEN]=0;
33 if (strlen(a) != STRLEN)
34 ASSERT (0);
35 #endif
38 void
39 testTortureExecute (void)
41 foo();
42 return;