summaryrefslogtreecommitdiff
path: root/regress/usr.bin/xlint
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2006-03-20 05:06:38 +0000
committerChad Loder <cloder@cvs.openbsd.org>2006-03-20 05:06:38 +0000
commit3952d1002ad14f0c04c5e6dd2c7c17ef5093c425 (patch)
treec52b0bf19cdc467f6a5baf47ac4f9adba48983c5 /regress/usr.bin/xlint
parent7a6bb336cbb26a5fd00bf8e7fdefede6589479d9 (diff)
Add a regression test for false positive with ((x == y) == z), fixed in
r1.31 of usr.bin/xlint/lint1/tree.c
Diffstat (limited to 'regress/usr.bin/xlint')
-rw-r--r--regress/usr.bin/xlint/Makefile4
-rw-r--r--regress/usr.bin/xlint/test-16.c22
-rw-r--r--regress/usr.bin/xlint/test-16.c.exp1
3 files changed, 25 insertions, 2 deletions
diff --git a/regress/usr.bin/xlint/Makefile b/regress/usr.bin/xlint/Makefile
index ac50bd29082..e00b8e5e9bd 100644
--- a/regress/usr.bin/xlint/Makefile
+++ b/regress/usr.bin/xlint/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.18 2005/12/16 03:02:22 cloder Exp $
+# $OpenBSD: Makefile,v 1.19 2006/03/20 05:06:37 cloder Exp $
-TEST_MODULES= 1 2 3 4 5 6 7 8 9 10 12 13 14 15
+TEST_MODULES= 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16
LINT= lint
LINTFLAGS?= -chapbx
diff --git a/regress/usr.bin/xlint/test-16.c b/regress/usr.bin/xlint/test-16.c
new file mode 100644
index 00000000000..3cedb209fb8
--- /dev/null
+++ b/regress/usr.bin/xlint/test-16.c
@@ -0,0 +1,22 @@
+ /* $OpenBSD: test-16.c,v 1.1 2006/03/20 05:06:37 cloder Exp $ */
+
+/*
+ * Placed in the public domain by Chad Loder <cloder@openbsd.org>.
+ *
+ * Test lint dealing with cascaded ==
+ */
+#include <sys/types.h>
+
+/* ARGSUSED */
+int
+main(int argc, char* argv[])
+{
+ mode_t mode;
+
+ mode = (mode_t)argc;
+
+ if ((((mode) & 0170000) == 0100000) == 0)
+ return 1;
+
+ return 0;
+}
diff --git a/regress/usr.bin/xlint/test-16.c.exp b/regress/usr.bin/xlint/test-16.c.exp
new file mode 100644
index 00000000000..b591b702fb4
--- /dev/null
+++ b/regress/usr.bin/xlint/test-16.c.exp
@@ -0,0 +1 @@
+Lint pass2: