1 /*
2    pr43236.c from the execute part of the gcc torture tests.
3  */
4 
5 #include <testfwk.h>
6 
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
10 
11 #include <string.h>
12 
13 void
testTortureExecute(void)14 testTortureExecute (void)
15 {
16 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pic14) // Lack of memory
17   char A[30], B[30], C[30];
18   int i;
19 
20   /* prepare arrays */
21   memset(A, 1, 30);
22   memset(B, 1, 30);
23 
24   for (i = 20; i-- > 10;) {
25     A[i] = 0;
26     B[i] = 0;
27   }
28 
29   /* expected result */
30   memset(C, 1, 30);
31   memset(C + 10, 0, 10);
32 
33   /* show result */
34 /*  for (i = 0; i < 30; i++)
35     printf("%d %d %d\n", A[i], B[i], C[i]); */
36 
37   /* compare results */
38   if (memcmp(A, C, 30) || memcmp(B, C, 30)) ASSERT(0);
39 #endif
40 
41   return;
42 }
43 
44