struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-3282.c
blob6e07d6fd3e716ea2349fd8e60cca4456eada2882
1 /*
2 bug-3282.c. On stm8, the register allocator decided that one byte of a stack-pointer-relative address
3 should be rematerialized, and the other stored in a register. stm8 code generation can't handle that yet.
4 */
6 #include <testfwk.h>
8 void g1(void);
10 void f1(void)
12 _Bool i;
13 if (&i)
14 g1();
17 void g2(void);
19 void f2(void)
21 _Bool i;
22 _Bool *volatile p = &i;
23 if (p)
24 g2();
27 void
28 testBug (void)
30 f1();
31 f2();
34 int g;
36 void g1(void)
38 ASSERT(++g == 1);
41 void g2(void)
43 ASSERT(++g == 2);