summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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