Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug-3056.c
blob9ae13ec1866f3656a9772a5f075110932f294be8
1 /*
2 bug-3056.c - function name not promoted to function pointer
3 inside conditional operator
4 */
6 #include <testfwk.h>
8 unsigned char x;
10 void f1(void)
12 x = 1;
15 void f2(void)
17 x = 2;
20 void bug(int i)
22 (i ? f1 : f2)();
25 void testBug(void)
27 ASSERT(x == 0);
28 bug(1);
29 ASSERT(x == 1);
30 bug(0);
31 ASSERT(x == 2);