1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
/* promoting bit to char */ #include <testfwk.h> #ifdef __SDCC #pragma std_sdcc99 #endif #include <stdbool.h> #if !defined(__bool_true_false_are_defined) volatile int a = 1, b = 1; #else volatile bool a = 1, b = 1; #endif char foo (void) { return (a << 1) | b; } static void testBitToCharPromotion(void) { ASSERT(foo() == 3); }