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