xref: /illumos-gate/usr/src/tools/smatch/src/validation/sm_math2.c (revision 1f5207b7604fb44407eb4342aff613f7c4508508)
1*1f5207b7SJohn Levon #include "check_debug.h"
2*1f5207b7SJohn Levon 
3*1f5207b7SJohn Levon unsigned char buf[2];
4*1f5207b7SJohn Levon 
test(void)5*1f5207b7SJohn Levon void test(void)
6*1f5207b7SJohn Levon {
7*1f5207b7SJohn Levon 	int a = buf[1];
8*1f5207b7SJohn Levon 	int b = buf[0] << 8;
9*1f5207b7SJohn Levon 	int c = (buf[0] << 8) | buf[1];
10*1f5207b7SJohn Levon 
11*1f5207b7SJohn Levon 	__smatch_implied(a);
12*1f5207b7SJohn Levon 	__smatch_implied(b);
13*1f5207b7SJohn Levon 	__smatch_implied(c);
14*1f5207b7SJohn Levon }
15*1f5207b7SJohn Levon 
16*1f5207b7SJohn Levon /*
17*1f5207b7SJohn Levon  * check-name: smatch math #2
18*1f5207b7SJohn Levon  * check-command: smatch -I.. sm_math2.c
19*1f5207b7SJohn Levon  *
20*1f5207b7SJohn Levon  * check-output-start
21*1f5207b7SJohn Levon sm_math2.c:11 test() implied: a = '0-255'
22*1f5207b7SJohn Levon sm_math2.c:12 test() implied: b = '0,256-65280'
23*1f5207b7SJohn Levon sm_math2.c:13 test() implied: c = '0-u16max'
24*1f5207b7SJohn Levon  * check-output-end
25*1f5207b7SJohn Levon  */
26