summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2005-12-01 05:07:56 +0000
committerChad Loder <cloder@cvs.openbsd.org>2005-12-01 05:07:56 +0000
commita346fee8b72d1a8d20c6199c0f6d4e50fb2e39e5 (patch)
treecbe627b8ce09d3ab80005b319e5d0bcd57b260c3 /regress
parent5dab7737fedf6f56432ce16e7e3c1f30ad588fa8 (diff)
Add regression test for lint2 being less noisy about "foo declared but
never used or defined".
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/xlint/Makefile4
-rw-r--r--regress/usr.bin/xlint/test-8.c18
-rw-r--r--regress/usr.bin/xlint/test-8.c.exp2
-rw-r--r--regress/usr.bin/xlint/test-8.h4
4 files changed, 26 insertions, 2 deletions
diff --git a/regress/usr.bin/xlint/Makefile b/regress/usr.bin/xlint/Makefile
index 0324ddb189f..b172d9e7fb8 100644
--- a/regress/usr.bin/xlint/Makefile
+++ b/regress/usr.bin/xlint/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.7 2005/11/30 19:44:08 cloder Exp $
+# $OpenBSD: Makefile,v 1.8 2005/12/01 05:07:55 cloder Exp $
-TEST_MODULES= 1 2 3 4 5 6 7
+TEST_MODULES= 1 2 3 4 5 6 7 8
LINT= lint
LINTFLAGS?= -chapbx
diff --git a/regress/usr.bin/xlint/test-8.c b/regress/usr.bin/xlint/test-8.c
new file mode 100644
index 00000000000..6160149c317
--- /dev/null
+++ b/regress/usr.bin/xlint/test-8.c
@@ -0,0 +1,18 @@
+/* $OpenBSD: test-8.c,v 1.1 2005/12/01 05:07:55 cloder Exp $ */
+
+/*
+ * Placed in the public domain by Chad Loder <cloder@openbsd.org>.
+ *
+ * Test warning on things declared in the translation unit but never
+ * defined.
+ */
+#include "test-8.h"
+
+int foo(int); /* warning: declared but never used or defined */
+
+/* ARGSUSED */
+int
+main(int argc, char* argv[])
+{
+ return 0;
+}
diff --git a/regress/usr.bin/xlint/test-8.c.exp b/regress/usr.bin/xlint/test-8.c.exp
new file mode 100644
index 00000000000..8e2e1628b4e
--- /dev/null
+++ b/regress/usr.bin/xlint/test-8.c.exp
@@ -0,0 +1,2 @@
+Lint pass2:
+foo declared( test-8.c(11) ), but never used or defined
diff --git a/regress/usr.bin/xlint/test-8.h b/regress/usr.bin/xlint/test-8.h
new file mode 100644
index 00000000000..04225e88d15
--- /dev/null
+++ b/regress/usr.bin/xlint/test-8.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: test-8.h,v 1.1 2005/12/01 05:07:55 cloder Exp $ */
+
+int bar(int); /* should not warn */
+