1 /* Test for bugs in equality comparison that are sensitive to regoster allocation (as #2621 was)
3 type: unsigned long, unsigned long long
11 void t(unsigned int i
)
16 /* Try to get lower 16 bits allocated to register x on stm8 */
19 register {type
} v
= p
;
23 else if(v
== 0x00010000)
24 t((unsigned int)v
+ 1);
25 else if(v
== 0xffff0001)
26 t((unsigned int)v
+ 42);
33 #ifndef __SDCC_pdk14 // Lack of memory
34 #if !(defined (__SDCC_pdk15) && defined(__SDCC_STACK_AUTO)) // Lack of code memory
35 /* Try to get lower 16 bits allocated to register y on stm8*/
38 register {type
} v
= p
;
41 t((unsigned int)(v
>> 16));
42 else if(v
== 0x00010000)
43 t((unsigned int)(v
>> 16) + 1);
44 else if(v
== 0xffff0001)
45 t((unsigned int)(v
>> 16) + 42);
53 /* Try to get lower 8 bits allocated to register a on stm8*/
56 register {type
} v
= p
;
60 else if(v
== 0x00010000)
62 else if(v
== 0xffff0001)
76 ASSERT(f(0x55aa55aa) == 0x55aa55aa);
77 ASSERT(f(0x0000ffff) == 0x0000ffff);
78 #ifndef __SDCC_pdk14 // Lack of memory
79 #if !(defined (__SDCC_pdk15) && defined(__SDCC_STACK_AUTO)) // Lack of code memory
80 ASSERT(f(0xffff0001) == 0xffff0001);
82 ASSERT(g(0x55aa55aa) == 0x55aa55aa);
83 ASSERT(g(0x0000ffff) == 0x00000000);
84 ASSERT(g(0xffff0001) == 0x0000ffff);
86 ASSERT(h(0x55aa55aa) == 0x55aa55aa);
87 ASSERT(h(0x0000ffff) == 0x0000ffff);
88 ASSERT(h(0xffff0001) == 0xffff00ab);