12 __xdata
uint16_t g_arg_1
= 0;
19 #define sel_const1 (uint16_t)((g_arg_2 ? 0x1F09FFFFu : 0x101FFFFEu) >> 16)
20 #define sel_const2 (uint16_t)((g_arg_2 ? 0x101FFFF0u : 0x101FFFF1u) >> 16)
27 __xdata
uint8_t func_1_count
= 0;
28 __xdata
uint8_t func_2_count
= 0;
40 void func (uint32_t test_arg
)
42 uint16_t t
= test_arg
>> 16;
46 // the bug was the constant being loaded wrongly into the registers
47 // before the comparision, where one of the bytes got overwritten with
49 // this gets tested twice with different inputs so we get two mutually
50 // exclusive false positives if there is a bug, or two good hits if
54 // (t - g_arg_1 = 1020) > 101F T
55 // (t - g_arg_1 = 1020) > 1010 T (false positive)
56 // (t - g_arg_1 = 1020) > 1F1F F
57 // (t - g_arg_1 = 1020) > 1F10 F
60 // (t - g_arg_1 = 1F10) > 1F09 T
61 // (t - g_arg_1 = 1F10) > 1F1F F
62 // (t - g_arg_1 = 1F10) > 0909 T (false positive)
63 // (t - g_arg_1 = 1F10) > 091F F
65 if (t
- g_arg_1
> sel_const1
)
70 if (t
- g_arg_1
> sel_const2
)
88 ASSERT (func_1_count
== 2);
89 ASSERT (func_2_count
== 0);