view usr/src/tools/smatch/src/validation/optim/and-or-mask4.c @ 19241:79022555a4a9

11972 resync smatch Reviewed by: Robert Mustacchi <rm@fingolfin.org> Approved by: Dan McDonald <danmcd@joyent.com>
author John Levon <john.levon@joyent.com>
date Mon, 11 Nov 2019 16:23:50 +0000
parents
children
line wrap: on
line source

#define W	3
#define	S	8
#define M	(W << S)

static inline int fun(unsigned int x, unsigned int y)
{
	return ((x & W) | (y >> S)) << S;
}

int foo(unsigned int x, unsigned int y)
{
	return fun(x, y) & M;
}

/*
 * check-name: and-or-mask4
 * check-command: test-linearize -Wno-decl $file
 * check-known-to-fail
 *
 * check-output-ignore
 * check-output-pattern(1): shl\\.
 * check-output-pattern(1): or\\.
 * check-output-pattern(1): and\\.
 * check-output-excludes: lsr\\.
 */