aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-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
+ */