struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug3561215.c
blob790b28287c16ff2fc609aed3b0a04eeff0bb44c2
1 /* bug 1505811
2 * failed to compile due to incorrect calculation
3 * of offset for relative jump.
4 */
6 #pragma disable_warning 85
8 #include <testfwk.h>
10 #include <stdint.h>
12 typedef enum CORE_STATE {
13 CORE_START=0,
14 CORE_INVALID,
15 CORE_S1,
16 CORE_S2,
17 CORE_INT,
18 CORE_FLOAT,
19 CORE_EXPONENT,
20 CORE_SCIENTIFIC,
21 NUM_CORE_STATES
22 } core_state_e ;
24 uint16_t crcu32(uint32_t newval, uint16_t crc);
26 enum CORE_STATE core_state_transition(uint8_t **instr , uint32_t *transition_count)
28 return 0;
31 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pic14) // Lack of memory
32 void core_bench_state(uint32_t blksize, uint8_t *memblock,
33 int16_t seed1, int16_t step)
35 uint32_t final_counts[NUM_CORE_STATES];
36 uint32_t track_counts[NUM_CORE_STATES];
37 uint8_t *p=memblock;
38 uint32_t i;
40 for (i=0; i<NUM_CORE_STATES; i++) {
41 final_counts[i]=track_counts[i]=0;
44 while (*p!=0) {
45 enum CORE_STATE fstate=core_state_transition(&p,track_counts);
46 final_counts[fstate]++;
49 p=memblock;
50 while (p < (memblock+blksize)) {
51 if (*p!=',')
52 *p^=(uint8_t)seed1;
53 p+=step;
56 #endif
58 void
59 testBug(void)