xref: /illumos-gate/usr/src/tools/smatch/src/validation/optim/and-or-mask3u.c (revision f52943a93040563107b95bccb9db87d9971ef47d)
1 #define W	3
2 #define	S	8
3 #define M	(W << S)
4 
5 static inline int fun(unsigned int x, unsigned int y)
6 {
7 	return ((x & M) | (y << S)) >> S;
8 }
9 
10 int foo(unsigned int x, unsigned int y)
11 {
12 	return fun(x, y) & W;
13 }
14 
15 /*
16  * check-name: and-or-mask3u
17  * check-command: test-linearize -Wno-decl $file
18  * check-known-to-fail
19  *
20  * check-output-ignore
21  * check-output-pattern(1): lsr\\.
22  * check-output-pattern(1): or\\.
23  * check-output-pattern(1): and\\.
24  * check-output-excludes: shl\\.
25  */
26