struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2890326.c
blob5d151c6fb6d4fdef8204389acdaf9da6edd0f78a
1 /*
2 bug-2890326.c
3 */
5 #include <testfwk.h>
7 #include <stdint.h>
9 struct position
11 uint_fast8_t track;
12 uint_fast8_t flags;
15 #ifdef __SDCC_pdk14 // Lack of RAM
16 #define MAX_VEHICLES 2
17 #else
18 #define MAX_VEHICLES 9
19 #endif
21 struct vehicle
23 struct position ends[2];
24 struct vehicle *next, *previous;
27 struct vehicle vehicles[MAX_VEHICLES];
29 // Hangs sdcc (unless using --no-peep).
30 void f(void)
32 uint_fast8_t track;
33 track = vehicles[1].ends[0].track;
35 if(track != 4 && track != 5 && track != 6)
36 return;
38 for(;;);
41 void
42 testBug(void)
44 ASSERT(1);