Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug-2983.c
blobdb8873b4a88031421393b95f768ffad5fbf09986
1 /* bug-2093.c
2 iCode generation for a cast tried to read a non-literal operand as literal.
3 */
5 #include <testfwk.h>
7 typedef struct {
8 unsigned int v0;
9 unsigned int v1;
10 } test_t;
12 volatile unsigned char test=0;
14 int f(void) {
15 unsigned int *t4=&((test_t *)0)->v1;
16 test=(unsigned char)t4;
18 void *t6=(void *)&((test_t *)0)->v1; // Compilation failed with internal error on this line.
19 test=(unsigned char)t6;
21 return 0;
24 void
25 testBug(void)
27 ASSERT (!f());