aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2008-04-03 13:56:19 -0700
committerJosh Triplett <josh@freedesktop.org>2008-04-03 13:56:19 -0700
commit0a09c64fd78b874a4f3abda7f5cd844eb20b71f6 (patch)
tree86c34b916d9002b264d9c02aa9190c831362d4b6
parent33b0ef36fca702b0f911f3cae11f39fe5be25e51 (diff)
downloadsparse-0a09c64fd78b874a4f3abda7f5cd844eb20b71f6.tar.gz
Add test case for new warning about !x & y
Signed-off-by: Josh Triplett <josh@freedesktop.org>
-rw-r--r--validation/dubious-bitwise-with-not.c9
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 00000000..e076899a
--- /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
+ */