db/fixup_kernel.sh: fix clear_user() handling
[smatch.git] / validation / optim / canonical-add.c
blob6f32a61e20e8b9ce0ee092e64f8fc54d65e0e44b
1 int xpc_add_ypc(int x, int y)
3 return (x + 1) + (y + 1);
6 int xmc_add_ypc(int x, int y)
8 return (x - 1) + (y + 1);
11 int xpc_add_ymc(int x, int y)
13 return (x + 1) + (y - 1);
16 int xmc_add_ymc(int x, int y)
18 return (x - 1) + (y - 1);
21 int xpc_sub_ypc(int x, int y)
23 return (x + 1) - (y + 1);
26 int xmc_sub_ypc(int x, int y)
28 return (x - 1) - (y + 1);
31 int xpc_sub_ymc(int x, int y)
33 return (x + 1) - (y - 1);
36 int xmc_sub_ymc(int x, int y)
38 return (x - 1) - (y - 1);
42 * check-name: canonical-add
43 * check-description:
44 * 1) verify that constants in add/sub chains are
45 * pushed at the right of the whole chain.
46 * For example '(a + 1) + b' must be canonicalized into '(a + b) + 1'
47 * This is needed for '(a + 1) + b - 1' to be simplified into '(a + b)'
49 * check-command: test-linearize -Wno-decl $file
50 * check-known-to-fail
51 * check-output-ignore
53 * check-output-excludes: \\$1
54 * check-output-excludes: \\$-1