struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2313.c
bloba4d16bc82d165a8799686d89025300346a8b9639
1 /*
2 bug-2313.c - didn't compile (validateLink failed due to bug in jump-after-cast-optimization).
3 */
5 #include <testfwk.h>
7 #pragma disable_warning 85
9 #pragma std_c99
11 #include <stdint.h>
13 typedef uint16_t usize_t;
14 typedef int16_t arg_t;
16 typedef struct u_data {
17 arg_t u_argn1;
18 } u_data;
20 usize_t valaddr(const char *base, usize_t size)
22 return(0);
25 struct u_data udata;
27 #define statloc (int __data *)udata.u_argn1
29 void f(void)
31 statloc && !valaddr((char *) statloc, sizeof(int));
34 void testBug(void)
36 f();