1 /* bug-2859.c
2 Cannot compare function to 0.
3 */
4
a(void)5 void a(void) {}
6
7 #ifdef TEST1
b(void)8 int b(void)
9 {
10 /* compare function pointer to non-zero integer literal */
11 return a != 1; /* ERROR */
12 }
13 #endif
14
15 #ifdef TEST1
c(void)16 int c(void)
17 {
18 /* compare function pointer to 0 with an operator other than ==,!= */
19 return a >= 0; /* ERROR */
20 }
21 #endif
22
23 #ifdef TEST1
d(void)24 int d(void)
25 {
26 /* compare function pointer to 0 with an operator other than ==,!= */
27 return a < 0; /* ERROR */
28 }
29 #endif
30