3 type: bool, char, unsigned char, unsigned short, unsigned long
10 #pragma disable_warning 180 //no warning about using complement on bit/unsigned char
13 #if defined (SDCC_STACK_AUTO) || defined (SDCC_hc08) || defined (SDCC_z80)
17 #if defined (__GNUC__) && defined (__alpha__) && (__GNUC__ < 3)
18 /* since this fails on GCC 2.95.4 on alpha... */
26 char foo(bool a, bool b, char c)
31 char complement(bool a, bool b)
36 {type} _0 = 0, _1 = 1, _ff = 0xFF, _ffff = -1;
45 ASSERT (foo(x,3,4) == 6);
47 ASSERT (complement (~_0, 1));
48 ASSERT (complement (~_1, 1));
51 ASSERT (complement (~_ff, 0));
53 ASSERT (complement (~_ff, 1));
57 ASSERT (complement (~_ffff, 1));
58 #elif defined TYPE_char
59 ASSERT (complement (~_ffff, 0));
61 if (sizeof({type}) < sizeof(int))
62 ASSERT (complement (~_ffff, 1));
64 ASSERT (complement (~_ffff, 0));