xref: /illumos-gate/usr/src/tools/smatch/src/validation/sm_bitwise1.c (revision 8a2b682e57a046b828f37bcde1776f131ef4629f)
1 #include "check_debug.h"
2 
3 unsigned int x;
4 void test(void)
5 {
6 	__smatch_implied(x & 0x1);
7 	__smatch_implied(x & 0x2);
8 	__smatch_implied(x & ~(0xffU));
9 	__smatch_implied(x & ~(0xff));
10 }
11 
12 /*
13  * check-name: smatch bitwise #1
14  * check-command: smatch -I.. sm_bitwise1.c
15  *
16  * check-output-start
17 sm_bitwise1.c:6 test() implied: x & 1 = '0-1'
18 sm_bitwise1.c:7 test() implied: x & 2 = '0,2'
19 sm_bitwise1.c:8 test() implied: x & ~(255) = '0,256-4294967040'
20 sm_bitwise1.c:9 test() implied: x & ~(255) = '0,256-4294967040'
21  * check-output-end
22  */
23