diff options
author | Josh Triplett <josh@freedesktop.org> | 2008-04-03 13:56:19 -0700 |
---|---|---|
committer | Josh Triplett <josh@freedesktop.org> | 2008-04-03 13:56:19 -0700 |
commit | 0a09c64fd78b874a4f3abda7f5cd844eb20b71f6 (patch) | |
tree | 86c34b916d9002b264d9c02aa9190c831362d4b6 /validation | |
parent | catch !x & y brainos (diff) | |
download | sparse-0a09c64fd78b874a4f3abda7f5cd844eb20b71f6.tar.gz sparse-0a09c64fd78b874a4f3abda7f5cd844eb20b71f6.tar.bz2 sparse-0a09c64fd78b874a4f3abda7f5cd844eb20b71f6.zip |
Add test case for new warning about !x & y
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'validation')
-rw-r--r-- | validation/dubious-bitwise-with-not.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/validation/dubious-bitwise-with-not.c b/validation/dubious-bitwise-with-not.c new file mode 100644 index 0000000..e076899 --- /dev/null +++ b/validation/dubious-bitwise-with-not.c @@ -0,0 +1,9 @@ +static unsigned int ok1 = !1 && 2; +static unsigned int bad1 = !1 & 2; +/* + * check-name: Dubious bitwise operation on !x + * + * check-error-start +dubious-bitwise-with-not.c:2:31: warning: dubious: !x & y + * check-error-end + */ |