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