325a6ccfe05eb7768ccd51086642a43b2ece4848
[fw/sdcc] / support / regression / tests / bug-908454.c
1 /* promoting bit to char */
2
3 #include <testfwk.h>
4
5 #if defined(PORT_HOST)
6 volatile int a = 1, b = 1;
7 #else
8 volatile bit a = 1, b = 1;
9 #endif
10
11 char
12 foo (void)
13 {
14   return (a << 1) | b;
15 }
16
17 static void
18 testBitToCharPromotion(void)
19 {
20   ASSERT(foo() == 3);
21 }