xref: /illumos-gate/usr/src/tools/smatch/src/validation/choose_expr.c (revision 30165b7f6753bc3d48c52319bed7ec7b3ea36b3c)
1 static int x = __builtin_choose_expr(0,(char *)0,(void)0);
2 static int y = __builtin_choose_expr(1,(char *)0,(void)0);
3 static char s[42];
4 static int z = 1/(sizeof(__builtin_choose_expr(1,s,0)) - 42);
5 
6 /*
7  * check-name: choose expr builtin
8  * check-error-start
9 choose_expr.c:1:51: warning: incorrect type in initializer (different base types)
10 choose_expr.c:1:51:    expected int static [signed] [toplevel] x
11 choose_expr.c:1:51:    got void <noident>
12 choose_expr.c:2:41: warning: incorrect type in initializer (different base types)
13 choose_expr.c:2:41:    expected int static [signed] [toplevel] y
14 choose_expr.c:2:41:    got char *<noident>
15 choose_expr.c:4:17: warning: division by zero
16  * check-error-end
17  */
18