summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug-2890326.c
blob: 5d151c6fb6d4fdef8204389acdaf9da6edd0f78a (plain) (blame)
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
/*
    bug-2890326.c
*/

#include <testfwk.h>

#include <stdint.h>

struct position
{
	uint_fast8_t track;
	uint_fast8_t flags;
};

#ifdef __SDCC_pdk14 // Lack of RAM
#define MAX_VEHICLES 2
#else
#define MAX_VEHICLES 9
#endif

struct vehicle
{
	struct position ends[2];
	struct vehicle *next, *previous;
};

struct vehicle vehicles[MAX_VEHICLES];

// Hangs sdcc (unless using --no-peep).
void f(void)
{
	uint_fast8_t track;
	track = vehicles[1].ends[0].track;

	if(track != 4 && track != 5 && track != 6)
		return;

	for(;;);
}

void
testBug(void)
{
	ASSERT(1);
}