Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: add code coverage for ...
details: https://anonhg.NetBSD.org/src/rev/179ac6334359
branches: trunk
changeset: 984490:179ac6334359
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Jul 10 08:40:36 2021 +0000
description:
tests/lint: add code coverage for grammar rule parameter_declaration
diffstat:
tests/usr.bin/xlint/lint1/decl_arg.c | 19 +++++++++++++++++--
tests/usr.bin/xlint/lint1/decl_arg.exp | 1 +
2 files changed, 18 insertions(+), 2 deletions(-)
diffs (43 lines):
diff -r 751c8d6c6418 -r 179ac6334359 tests/usr.bin/xlint/lint1/decl_arg.c
--- a/tests/usr.bin/xlint/lint1/decl_arg.c Sat Jul 10 08:01:11 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl_arg.c Sat Jul 10 08:40:36 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl_arg.c,v 1.3 2021/07/10 08:01:11 rillig Exp $ */
+/* $NetBSD: decl_arg.c,v 1.4 2021/07/10 08:40:36 rillig Exp $ */
# 3 "decl_arg.c"
/*
@@ -102,9 +102,24 @@
* need to be enclosed by one more pair of parentheses than usual.
*/
void cover_direct_notype_param_decl(
- double (f1),
+ double (identifier),
double ((parenthesized)),
double (array[]),
double (array_size[3]),
double (*)(void (function()))
);
+
+/*
+ * Just some unrealistic code to cover the grammar rule parameter_declaration.
+ */
+/* expect+4: error: only register valid as formal parameter storage class [9] */
+void cover_parameter_declaration(
+ volatile, /* 1 */
+ double, /* 2 */
+ static storage_class, /* 3.1 */
+ const type_qualifier, /* 3.2 */
+ double (identifier), /* 4 */
+ const (*), /* 5 */
+ double *const, /* 6 */
+ ...
+);
diff -r 751c8d6c6418 -r 179ac6334359 tests/usr.bin/xlint/lint1/decl_arg.exp
--- a/tests/usr.bin/xlint/lint1/decl_arg.exp Sat Jul 10 08:01:11 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl_arg.exp Sat Jul 10 08:40:36 2021 +0000
@@ -25,3 +25,4 @@
decl_arg.c(79): error: declared argument postfix_attribute is missing [53]
decl_arg.c(81): error: declared argument infix_attribute is missing [53]
decl_arg.c(90): error: declared argument pointer_prefix_attribute is missing [53]
+decl_arg.c(119): error: only register valid as formal parameter storage class [9]
Home |
Main Index |
Thread Index |
Old Index