struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2712.c
blob8b1d84d4fcad681278a35926790aaa2b2e3e86aa
1 /*
2 bug-2458.c
3 In backends that support 16x16->32 multiplication, there was a bug when
4 operands to such a multiplication were used in multiple such multiplications.
5 */
7 #include <testfwk.h>
9 #ifndef __SDCC_pdk14 // Lack of memory - see RFE #606
10 int dummy(int x)
12 return x;
15 void dummy2(long x)
17 ASSERT(x == 42 * 42 || x == -42 * 42);
19 #endif
21 void testBug(void)
23 #ifndef __SDCC_pdk14 // Lack of memory
24 int i, j;
26 // Double use of i and j.
27 i = dummy(42);
28 j = dummy(42);
29 dummy2((long)i * (long)j);
30 i = -i;
31 dummy2((long)i * (long)j);
33 // Single use of i and j.
34 i = dummy(42);
35 j = dummy(42);
36 dummy2((long)i * (long)j);
37 #endif