db/fixup_kernel.sh: fix clear_user() handling
[smatch.git] / validation / optim / lsr-and1.c
blob393679e3f0456beeb2c76a5c2e6824ff3b3ecec8
1 // If (t >> S) is simplified into (x >> S)
2 // then the whole expression will be 0.
3 // The test is only interesting if the sub-expression
4 // (x & M) is referenced more than once
5 // (because otherwise other simplifications apply).
6 unsigned lsr_and1(unsigned x)
8 unsigned t = (x & 0xfffff000);
9 return ((t >> 12) ^ (x >> 12)) & t;
13 * check-name: lsr-and1
14 * check-command: test-linearize -Wno-decl $file
16 * check-output-ignore
17 * check-output-contains: ret\\..*\\$0$