xref: /illumos-gate/usr/src/tools/smatch/src/validation/optim/sh-or-and1.c (revision d17be682a2c70b4505d43c830bbd2603da11918d)
1 unsigned lsr_or_and1(unsigned x, unsigned b)
2 {
3 	return (((x & 0xfffff000) | b) >> 12);
4 }
5 
6 unsigned shl_or_and1(unsigned x, unsigned b)
7 {
8 	return (((x & 0x000fffff) | b) << 12);
9 }
10 
11 /*
12  * check-name: sh-or-and1
13  * check-command: test-linearize -Wno-decl $file
14  *
15  * check-output-ignore
16  * check-output-pattern(1): lsr\\.
17  * check-output-pattern(1): shl\\.
18  * check-output-pattern(2): or\\.
19  * check-output-excludes: and\\.
20  */
21