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 lint: add another test case for in...



details:   https://anonhg.NetBSD.org/src/rev/570899c70942
branches:  trunk
changeset: 952919:570899c70942
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Feb 21 09:19:53 2021 +0000

description:
lint: add another test case for initializing an object

diffstat:

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

diffs (22 lines):

diff -r 750c8a56ab9a -r 570899c70942 tests/usr.bin/xlint/lint1/d_c99_init.c
--- a/tests/usr.bin/xlint/lint1/d_c99_init.c    Sun Feb 21 09:17:55 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.c    Sun Feb 21 09:19:53 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_init.c,v 1.2 2021/02/21 09:07:58 rillig Exp $    */
+/*     $NetBSD: d_c99_init.c,v 1.3 2021/02/21 09:19:53 rillig Exp $    */
 # 3 "d_c99_init.c"
 
 /*
@@ -13,4 +13,5 @@
 // interpretation is "optionally enclosed in a single pair of braces".
 int scalar_without_braces = 3;
 int scalar_with_optional_braces = { 3 };
-int scalar_with_too_many_braces = {{ 3 }};     /* expect: 176 */
+int scalar_with_too_many_braces = {{ 3 }};             /* expect: 176 */
+int scalar_with_too_many_initializers = { 3, 5 };      /* expect: 174 */
diff -r 750c8a56ab9a -r 570899c70942 tests/usr.bin/xlint/lint1/d_c99_init.exp
--- a/tests/usr.bin/xlint/lint1/d_c99_init.exp  Sun Feb 21 09:17:55 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.exp  Sun Feb 21 09:19:53 2021 +0000
@@ -1,1 +1,2 @@
 d_c99_init.c(16): invalid initializer type int [176]
+d_c99_init.c(17): too many initializers [174]



Home | Main Index | Thread Index | Old Index