struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug3531687.c
blob6a01003630248bf684ac9d54800016180d5d0e72
1 /*
2 bug3531687.c
4 The bug resulted in wrong comparisons of char to bool, casting the char operand to bool.
5 */
7 #include <testfwk.h>
8 #include <stdbool.h>
10 #pragma std_c99
12 int f(char a, char flag)
14 if (a == (flag ? 1 : 0))
15 return 0;
16 return 1;
19 bool g(char a, bool b)
21 return (a > b);
24 void
25 testBug(void)
27 ASSERT(f(2, 1));
28 ASSERT(g(2, 1));