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 test for previous ...



details:   https://anonhg.NetBSD.org/src/rev/e34194a0deab
branches:  trunk
changeset: 379698:e34194a0deab
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Jun 15 08:48:49 2021 +0000

description:
tests/lint: add test for previous prototype declaration

diffstat:

 tests/usr.bin/xlint/lint1/msg_285.c   |  14 +++++++++++---
 tests/usr.bin/xlint/lint1/msg_285.exp |   3 ++-
 2 files changed, 13 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 436f12b85162 -r e34194a0deab tests/usr.bin/xlint/lint1/msg_285.c
--- a/tests/usr.bin/xlint/lint1/msg_285.c       Tue Jun 15 08:37:56 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_285.c       Tue Jun 15 08:48:49 2021 +0000
@@ -1,7 +1,15 @@
-/*     $NetBSD: msg_285.c,v 1.2 2021/02/21 09:07:58 rillig Exp $       */
+/*     $NetBSD: msg_285.c,v 1.3 2021/06/15 08:48:49 rillig Exp $       */
 # 3 "msg_285.c"
 
 // Test for message: prototype declaration [285]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -r */
+
+void function(int, int, int);  /* expect: 285 */
+
+/* ARGSUSED */
+extern void
+function(a, b)
+    int a, b;
+{                              /* expect: 3 declared, 2 defined */
+}
diff -r 436f12b85162 -r e34194a0deab tests/usr.bin/xlint/lint1/msg_285.exp
--- a/tests/usr.bin/xlint/lint1/msg_285.exp     Tue Jun 15 08:37:56 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_285.exp     Tue Jun 15 08:48:49 2021 +0000
@@ -1,1 +1,2 @@
-msg_285.c(6): error: syntax error ':' [249]
+msg_285.c(14): error: parameter mismatch: 3 declared, 2 defined [51]
+msg_285.c(8): prototype declaration [285]



Home | Main Index | Thread Index | Old Index