2 !!DESCRIPTION!! Pointer tests
3 !!ORIGIN!! SDCC regression tests
4 !!LICENCE!! GPL, read COPYING.GPL
10 unsigned char success = 0;
11 unsigned char failures = 0;
12 unsigned char dummy = 0;
14 #ifdef SUPPORT_BIT_TYPES
17 unsigned int aint0 = 0;
18 unsigned int aint1 = 0;
19 unsigned char achar0 = 0;
20 unsigned char achar1 = 0;
21 unsigned char *acharP = 0;
32 f1 (unsigned char *ucP)
45 f2 (unsigned int *uiP)
63 void f4(unsigned char *ucP, unsigned char uc)
74 void init_array(char start_value)
78 for(c=0; c<sizeof(buff); c++)
79 buff[c] = start_value++;
82 void check_array(char base_value)
86 for(c=0; c<sizeof(buff); c++)
87 if(buff[c] != (base_value+c))
91 void index_by_pointer(unsigned char *index, unsigned char expected_value)
93 if(buff[*index] != expected_value)
103 if(buff[achar0 + 7] != 4+7)
106 dummy = buff[achar0];
111 if(dummy != (buff[achar0+1] -1))
114 index_by_pointer(&dummy, 8);
120 if ((acharP == 0) || (*acharP))
131 printf("failures: %d\n",failures);