summaryrefslogtreecommitdiff
path: root/regress/usr.bin
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2005-11-21 18:25:58 +0000
committerChad Loder <cloder@cvs.openbsd.org>2005-11-21 18:25:58 +0000
commit3e53c7526c9e93e584fee70a723c8a0bd8800334 (patch)
treeb7b109cb23e2e1c48f6367870f410b18098f438f /regress/usr.bin
parent0bec780131c1105ad6cf2a2cbc989ee84ffdbb10 (diff)
Basic regress framework for xlint. Not hooked up yet.
OK deraadt, input from millert
Diffstat (limited to 'regress/usr.bin')
-rw-r--r--regress/usr.bin/xlint/Makefile18
-rw-r--r--regress/usr.bin/xlint/test-1.c21
-rw-r--r--regress/usr.bin/xlint/test-1.c.exp5
3 files changed, 44 insertions, 0 deletions
diff --git a/regress/usr.bin/xlint/Makefile b/regress/usr.bin/xlint/Makefile
new file mode 100644
index 00000000000..53b9c7c81d6
--- /dev/null
+++ b/regress/usr.bin/xlint/Makefile
@@ -0,0 +1,18 @@
+# $OpenBSD: Makefile,v 1.1 2005/11/21 18:25:57 cloder Exp $
+
+TEST_MODULES= 1
+LINT= lint
+LINTFLAGS?= -chapbx
+
+.for i in ${TEST_MODULES}
+REGRESS_TARGETS+= test-${i}
+test-${i}:
+ ${LINT} ${LINTFLAGS} test-${i}.c 2>&1 | diff -u - ${.CURDIR}/test-${i}.c.exp
+.endfor
+
+.PHONY: ${REGRESS_TARGETS}
+
+NOOBJ= Yes
+
+.include <bsd.regress.mk>
+
diff --git a/regress/usr.bin/xlint/test-1.c b/regress/usr.bin/xlint/test-1.c
new file mode 100644
index 00000000000..f35c2c8eb9d
--- /dev/null
+++ b/regress/usr.bin/xlint/test-1.c
@@ -0,0 +1,21 @@
+/* $OpenBSD: test-1.c,v 1.1 2005/11/21 18:25:57 cloder Exp $ */
+
+/*
+ * This program is in the public domain.
+ *
+ * Test the ARGSUSED feature of lint.
+ */
+
+int
+unusedargs(int unused)
+{
+ return 0;
+}
+
+/* ARGSUSED */
+int
+main(int argc, char* argv[])
+{
+ unusedargs(1);
+ return 0;
+}
diff --git a/regress/usr.bin/xlint/test-1.c.exp b/regress/usr.bin/xlint/test-1.c.exp
new file mode 100644
index 00000000000..b16f48aa242
--- /dev/null
+++ b/regress/usr.bin/xlint/test-1.c.exp
@@ -0,0 +1,5 @@
+test-1.c:
+test-1.c(10): warning: argument unused unused in function unusedargs
+lint: cannot find llib-lc.ln
+Lint pass2:
+unusedargs returns value which is always ignored