summaryrefslogtreecommitdiff
path: root/regress/usr.bin/xlint
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2005-12-03 01:04:07 +0000
committerChad Loder <cloder@cvs.openbsd.org>2005-12-03 01:04:07 +0000
commitb9cba617f4250d0350d5dae64ba6254959691ea5 (patch)
tree6d0febfd873d3d0b325a8187244973ca44bd493c /regress/usr.bin/xlint
parentef47fbf93d2302d521921cce5f98a093b4779e9f (diff)
Add a couple more __attribute__ test cases to test 11, and hook up 11
now that lint deals with attributes.
Diffstat (limited to 'regress/usr.bin/xlint')
-rw-r--r--regress/usr.bin/xlint/Makefile4
-rw-r--r--regress/usr.bin/xlint/test-11.c22
-rw-r--r--regress/usr.bin/xlint/test-11.c.exp16
3 files changed, 37 insertions, 5 deletions
diff --git a/regress/usr.bin/xlint/Makefile b/regress/usr.bin/xlint/Makefile
index a6b0c8bbeab..b5d60539a35 100644
--- a/regress/usr.bin/xlint/Makefile
+++ b/regress/usr.bin/xlint/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.10 2005/12/02 21:24:09 grunk Exp $
+# $OpenBSD: Makefile,v 1.11 2005/12/03 01:04:06 cloder Exp $
-TEST_MODULES= 1 2 3 4 5 6 7 8 9 10
+TEST_MODULES= 1 2 3 4 5 6 7 8 9 10 11
LINT= lint
LINTFLAGS?= -chapbx
diff --git a/regress/usr.bin/xlint/test-11.c b/regress/usr.bin/xlint/test-11.c
index 96c867222f4..510906bc0f8 100644
--- a/regress/usr.bin/xlint/test-11.c
+++ b/regress/usr.bin/xlint/test-11.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: test-11.c,v 1.1 2005/12/02 22:11:46 cloder Exp $ */
+/* $OpenBSD: test-11.c,v 1.2 2005/12/03 01:04:06 cloder Exp $ */
/*
* Placed in the public domain by Chad Loder <cloder@openbsd.org>.
@@ -35,12 +35,28 @@ void foo4(void)
__attribute__((__pure__))
__attribute__((__section__("text")));
+/*
+ * A function prototype with multiple attributes after,
+ * one of which (volatile) is stupidly also a C keyword.
+ */
+__attribute__((__noreturn__)) void foo5(const char *, ...)
+ __attribute__((volatile, __format__ (printf, 1, 2)));
+
+/*
+ * A function prototype with unnamed parameters having attributes.
+ */
+void foo6(char[], int __attribute__((unused)));
+
+/*
+ * A function prototype with named parameters having attributes.
+ */
+void foo7(char func[], int i __attribute__((unused)));
/*
* A function definition with a single attribute before.
*/
__attribute__((__noreturn__)) void
-foo5(void)
+foo8(void)
{
exit(0);
}
@@ -52,7 +68,7 @@ __attribute__((__noreturn__))
__attribute__((__pure__))
__attribute__((__section__("text")))
void
-foo6(void)
+foo9(void)
{
exit(0);
}
diff --git a/regress/usr.bin/xlint/test-11.c.exp b/regress/usr.bin/xlint/test-11.c.exp
new file mode 100644
index 00000000000..2e3b18a0968
--- /dev/null
+++ b/regress/usr.bin/xlint/test-11.c.exp
@@ -0,0 +1,16 @@
+test-11.c(126): warning: argument argc unused in function main
+test-11.c(126): warning: argument argv unused in function main
+Lint pass2:
+foo1 declared( test-11.c(15) ), but never used or defined
+foo2 declared( test-11.c(23) ), but never used or defined
+foo3 declared( test-11.c(28) ), but never used or defined
+foo4 declared( test-11.c(36) ), but never used or defined
+foo5 declared( test-11.c(43) ), but never used or defined
+foo6 declared( test-11.c(48) ), but never used or defined
+foo7 declared( test-11.c(53) ), but never used or defined
+foo8 defined( test-11.c(59) ), but never used
+foo9 defined( test-11.c(71) ), but never used
+pac defined( test-11.c(117) ), but never used
+f defined( test-11.c(123) ), but never used
+sh2 defined( test-11.c(112) ), but never used
+sh defined( test-11.c(107) ), but never used