summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug3561215.c
blob: 790b28287c16ff2fc609aed3b0a04eeff0bb44c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* bug 1505811
 *  failed to compile due to incorrect calculation
 *  of offset for relative jump.
 */

#pragma disable_warning 85

#include <testfwk.h>

#include <stdint.h>

typedef enum CORE_STATE {
	CORE_START=0,
	CORE_INVALID,
	CORE_S1,
	CORE_S2,
	CORE_INT,
	CORE_FLOAT,
	CORE_EXPONENT,
	CORE_SCIENTIFIC,
	NUM_CORE_STATES
} core_state_e ;

uint16_t crcu32(uint32_t newval, uint16_t crc);

enum CORE_STATE core_state_transition(uint8_t **instr , uint32_t *transition_count)
{
	return 0;
}

#if !defined(__SDCC_pdk14) && !defined(__SDCC_pic14) // Lack of memory
void core_bench_state(uint32_t blksize, uint8_t *memblock, 
		int16_t seed1, int16_t step) 
{
	uint32_t final_counts[NUM_CORE_STATES];
	uint32_t track_counts[NUM_CORE_STATES];
	uint8_t *p=memblock;
	uint32_t i;

	for (i=0; i<NUM_CORE_STATES; i++) {
		final_counts[i]=track_counts[i]=0;
	}

	while (*p!=0) {
		enum CORE_STATE fstate=core_state_transition(&p,track_counts);
		final_counts[fstate]++;
	}

	p=memblock;
	while (p < (memblock+blksize)) {
		if (*p!=',')
			*p^=(uint8_t)seed1;
		p+=step;
	}
}
#endif

void
testBug(void)
{
}