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: test message for redec...
details: https://anonhg.NetBSD.org/src/rev/f1b6511f9310
branches: trunk
changeset: 1022963:f1b6511f9310
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Aug 16 06:30:43 2021 +0000
description:
tests/lint: test message for redeclared tags
diffstat:
tests/usr.bin/xlint/lint1/msg_046.c | 35 ++++++++++++++++++++++++++++++++---
tests/usr.bin/xlint/lint1/msg_046.exp | 18 +++++++++++++++++-
2 files changed, 49 insertions(+), 4 deletions(-)
diffs (65 lines):
diff -r 98f57456555e -r f1b6511f9310 tests/usr.bin/xlint/lint1/msg_046.c
--- a/tests/usr.bin/xlint/lint1/msg_046.c Mon Aug 16 06:25:45 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_046.c Mon Aug 16 06:30:43 2021 +0000
@@ -1,7 +1,36 @@
-/* $NetBSD: msg_046.c,v 1.2 2021/02/21 09:07:58 rillig Exp $ */
+/* $NetBSD: msg_046.c,v 1.3 2021/08/16 06:30:43 rillig Exp $ */
# 3 "msg_046.c"
// Test for message: (%s) tag redeclared [46]
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+/* expect+1: warning: struct tag1 never defined [233] */
+struct tag1;
+/* expect+2: error: (struct) tag redeclared [46] */
+/* expect+1: warning: union tag1 never defined [234] */
+union tag1;
+
+/* expect+1: warning: union tag2 never defined [234] */
+union tag2;
+/* expect+2: error: (union) tag redeclared [46] */
+/* expect+1: warning: enum tag2 never defined [235] */
+enum tag2;
+
+/* expect+1: warning: enum tag3 never defined [235] */
+enum tag3;
+/* expect+2: error: (enum) tag redeclared [46] */
+/* expect+1: warning: struct tag3 never defined [233] */
+struct tag3;
+
+/* expect+2: error: (union) tag redeclared [46] */
+/* expect+1: warning: struct tag1 never defined [233] */
+struct tag1 *use_tag1(void);
+/* expect+2: error: (enum) tag redeclared [46] */
+/* expect+1: warning: union tag2 never defined [234] */
+union tag2 *use_tag2(void);
+/* expect+2: error: (struct) tag redeclared [46] */
+/* expect+1: warning: enum tag3 never defined [235] */
+enum tag3 *use_tag3(void);
+
+/* expect+2: error: (struct) tag redeclared [46] */
+/* expect+1: warning: union tag1 never defined [234] */
+union tag1 *mismatch_tag1(void);
diff -r 98f57456555e -r f1b6511f9310 tests/usr.bin/xlint/lint1/msg_046.exp
--- a/tests/usr.bin/xlint/lint1/msg_046.exp Mon Aug 16 06:25:45 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_046.exp Mon Aug 16 06:30:43 2021 +0000
@@ -1,1 +1,17 @@
-msg_046.c(6): error: syntax error ':' [249]
+msg_046.c(10): error: (struct) tag redeclared [46]
+msg_046.c(16): error: (union) tag redeclared [46]
+msg_046.c(22): error: (enum) tag redeclared [46]
+msg_046.c(26): error: (union) tag redeclared [46]
+msg_046.c(29): error: (enum) tag redeclared [46]
+msg_046.c(32): error: (struct) tag redeclared [46]
+msg_046.c(36): error: (struct) tag redeclared [46]
+msg_046.c(7): warning: struct tag1 never defined [233]
+msg_046.c(10): warning: union tag1 never defined [234]
+msg_046.c(13): warning: union tag2 never defined [234]
+msg_046.c(16): warning: enum tag2 never defined [235]
+msg_046.c(19): warning: enum tag3 never defined [235]
+msg_046.c(22): warning: struct tag3 never defined [233]
+msg_046.c(26): warning: struct tag1 never defined [233]
+msg_046.c(29): warning: union tag2 never defined [234]
+msg_046.c(32): warning: enum tag3 never defined [235]
+msg_046.c(36): warning: union tag1 never defined [234]
Home |
Main Index |
Thread Index |
Old Index