summaryrefslogtreecommitdiff
path: root/tests/usr.bin
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2023-06-24 06:55:34 +0000
committerrillig <rillig@NetBSD.org>2023-06-24 06:55:34 +0000
commitbbbb5a71d99f6eb815bbdf0b789038af407d72ba (patch)
treede74e7d8735a09b7bb2c5151afc86afda9d28e89 /tests/usr.bin
parent96718dd1c216fdb7f83c89fb7440195b2ee88bfa (diff)
lint: add query for redundant 'extern' in function declaration
Diffstat (limited to 'tests/usr.bin')
-rw-r--r--tests/usr.bin/xlint/lint1/queries.c12
-rw-r--r--tests/usr.bin/xlint/lint1/t_usage.sh8
2 files changed, 13 insertions, 7 deletions
diff --git a/tests/usr.bin/xlint/lint1/queries.c b/tests/usr.bin/xlint/lint1/queries.c
index 01c2d06fe53..4c3873def98 100644
--- a/tests/usr.bin/xlint/lint1/queries.c
+++ b/tests/usr.bin/xlint/lint1/queries.c
@@ -1,4 +1,4 @@
-/* $NetBSD: queries.c,v 1.15 2023/06/22 13:57:44 rillig Exp $ */
+/* $NetBSD: queries.c,v 1.16 2023/06/24 06:55:34 rillig Exp $ */
# 3 "queries.c"
/*
@@ -15,7 +15,7 @@
* such as casts between arithmetic types.
*/
-/* lint1-extra-flags: -q 1,2,3,4,5,6,7,8,9,10,11,12 -X 351 */
+/* lint1-extra-flags: -q 1,2,3,4,5,6,7,8,9,10,11,12,13 -X 351 */
typedef unsigned char u8_t;
typedef unsigned short u16_t;
@@ -156,7 +156,7 @@ Q6(int i)
i = (int)i + 1;
}
-extern void *allocate(void);
+void *allocate(void);
void
Q7(void)
@@ -397,6 +397,12 @@ Q12(void)
u16 += u8, u32 += u16;
}
+/* expect+1: redundant 'extern' in function declaration of 'extern_Q13' [Q13] */
+extern void extern_Q13(void);
+void extern_Q13(void);
+/* expect+1: redundant 'extern' in function declaration of 'extern_Q13' [Q13] */
+extern void extern_Q13(void), *extern_ptr;
+
/*
* Since queries do not affect the exit status, force a warning to make this
* test conform to the general expectation that a test that produces output
diff --git a/tests/usr.bin/xlint/lint1/t_usage.sh b/tests/usr.bin/xlint/lint1/t_usage.sh
index 4a976d795c7..ade5f88093d 100644
--- a/tests/usr.bin/xlint/lint1/t_usage.sh
+++ b/tests/usr.bin/xlint/lint1/t_usage.sh
@@ -1,4 +1,4 @@
-# $NetBSD: t_usage.sh,v 1.5 2023/06/22 13:57:44 rillig Exp $
+# $NetBSD: t_usage.sh,v 1.6 2023/06/24 06:55:34 rillig Exp $
#
# Copyright (c) 2023 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -97,13 +97,13 @@ enable_queries_body()
# The largest known query.
atf_check \
- "$lint1" -q 12 code.c /dev/null
+ "$lint1" -q 13 code.c /dev/null
# Larger than the largest known query.
atf_check \
-s 'exit:1' \
- -e "inline:lint1: invalid query ID '13'\n" \
- "$lint1" -q 13 code.c /dev/null
+ -e "inline:lint1: invalid query ID '14'\n" \
+ "$lint1" -q 14 code.c /dev/null
# Whitespace is not allowed before a query ID.
atf_check \