struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr43236.c
blob825f05251e850ae78b3aef79e3a0e5bfbc3c7b66
1 /*
2 pr43236.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 #include <string.h>
13 void
14 testTortureExecute (void)
16 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pic14) // Lack of memory
17 char A[30], B[30], C[30];
18 int i;
20 /* prepare arrays */
21 memset(A, 1, 30);
22 memset(B, 1, 30);
24 for (i = 20; i-- > 10;) {
25 A[i] = 0;
26 B[i] = 0;
29 /* expected result */
30 memset(C, 1, 30);
31 memset(C + 10, 0, 10);
33 /* show result */
34 /* for (i = 0; i < 30; i++)
35 printf("%d %d %d\n", A[i], B[i], C[i]); */
37 /* compare results */
38 if (memcmp(A, C, 30) || memcmp(B, C, 30)) ASSERT(0);
39 #endif
41 return;