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 unknown member na...



details:   https://anonhg.NetBSD.org/src/rev/260693759001
branches:  trunk
changeset: 954129:260693759001
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Mar 29 22:36:31 2021 +0000

description:
tests/lint: test unknown member name in struct

I had not expected to trigger another assertion, I just wanted to make
sure my latest ongoing refactoring will not break this case.  Apparently
there is no need to worry about that.

diffstat:

 tests/usr.bin/xlint/lint1/d_c99_init.c   |  21 ++++++++++++++++++++-
 tests/usr.bin/xlint/lint1/d_c99_init.exp |   2 ++
 2 files changed, 22 insertions(+), 1 deletions(-)

diffs (41 lines):

diff -r 54640472a1d7 -r 260693759001 tests/usr.bin/xlint/lint1/d_c99_init.c
--- a/tests/usr.bin/xlint/lint1/d_c99_init.c    Mon Mar 29 22:24:34 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.c    Mon Mar 29 22:36:31 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_init.c,v 1.21 2021/03/29 22:07:00 rillig Exp $   */
+/*     $NetBSD: d_c99_init.c,v 1.22 2021/03/29 22:36:31 rillig Exp $   */
 # 3 "d_c99_init.c"
 
 /*
@@ -328,3 +328,22 @@
                break;
        }
 }
+
+struct point unknown_member_name_beginning = {
+       // FIXME: assertion "bl->bl_type != NULL" failed in initialization_push
+       // .r = 5,
+       .x = 4,
+       .y = 3,
+};
+
+struct point unknown_member_name_middle = {
+       .x = 4,
+       .r = 5,                 /* expect: undefined struct/union member: r */
+       .y = 3,
+};
+
+struct point unknown_member_name_end = {
+       .x = 4,
+       .y = 3,
+       .r = 5,                 /* expect: undefined struct/union member: r */
+};
diff -r 54640472a1d7 -r 260693759001 tests/usr.bin/xlint/lint1/d_c99_init.exp
--- a/tests/usr.bin/xlint/lint1/d_c99_init.exp  Mon Mar 29 22:24:34 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.exp  Mon Mar 29 22:36:31 2021 +0000
@@ -6,3 +6,5 @@
 d_c99_init.c(238): warning: illegal combination of integer (char) and pointer (pointer to char) [183]
 d_c99_init.c(244): error: too many array initializers, expected 8 [173]
 d_c99_init.c(324): error: duplicate case in switch: 0 [199]
+d_c99_init.c(341): error: undefined struct/union member: r [101]
+d_c99_init.c(348): error: undefined struct/union member: r [101]



Home | Main Index | Thread Index | Old Index