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: demonstrate assertion ...



details:   https://anonhg.NetBSD.org/src/rev/3fbd35713fa1
branches:  trunk
changeset: 960818:3fbd35713fa1
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Mar 29 22:42:10 2021 +0000

description:
tests/lint: demonstrate assertion failures for union initialization

diffstat:

 tests/usr.bin/xlint/lint1/d_c99_init.c |  19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r e5dabaefed60 -r 3fbd35713fa1 tests/usr.bin/xlint/lint1/d_c99_init.c
--- a/tests/usr.bin/xlint/lint1/d_c99_init.c    Mon Mar 29 22:36:31 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.c    Mon Mar 29 22:42:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_init.c,v 1.22 2021/03/29 22:36:31 rillig Exp $   */
+/*     $NetBSD: d_c99_init.c,v 1.23 2021/03/29 22:42:10 rillig Exp $   */
 # 3 "d_c99_init.c"
 
 /*
@@ -347,3 +347,20 @@
        .y = 3,
        .r = 5,                 /* expect: undefined struct/union member: r */
 };
+
+union value {
+       int int_value;
+       void *pointer_value;
+};
+
+union value unknown_union_member_name_first = {
+       // FIXME: assertion "bl->bl_type != NULL" failed in initialization_push
+       // .unknown_value = 4,
+       .int_value = 3,
+};
+
+union value unknown_union_member_name_second = {
+       .int_value = 3,
+       // FIXME: assertion "bl->bl_type->t_tspec == ARRAY" failed in brace_level_extend_if_array_of_unknown_size
+       // .unknown_value = 4,
+};



Home | Main Index | Thread Index | Old Index