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 error handling in...



details:   https://anonhg.NetBSD.org/src/rev/8f00cb9d0011
branches:  trunk
changeset: 1022256:8f00cb9d0011
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 10 19:30:19 2021 +0000

description:
tests/lint: test error handling in enum-specifier

diffstat:

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

diffs (36 lines):

diff -r df48f1b4f021 -r 8f00cb9d0011 tests/usr.bin/xlint/lint1/decl.c
--- a/tests/usr.bin/xlint/lint1/decl.c  Sat Jul 10 19:29:28 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl.c  Sat Jul 10 19:30:19 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: decl.c,v 1.1 2021/07/10 18:25:57 rillig Exp $  */
+/*     $NetBSD: decl.c,v 1.2 2021/07/10 19:30:19 rillig Exp $  */
 # 3 "decl.c"
 
 /*
@@ -71,3 +71,18 @@
        /* expect+1: converting 'pointer to pointer to char' to incompatible 'pointer to double' */
        sink(ppc);
 }
+
+_Bool
+enum_error_handling(void)
+{
+       enum {
+               /* expect+1: syntax error '"' [249] */
+               "error 1"
+               :               /* still the same error */
+               ,               /* back on track */
+               A,
+               B
+       } x = A;
+
+       return x == B;
+}
diff -r df48f1b4f021 -r 8f00cb9d0011 tests/usr.bin/xlint/lint1/decl.exp
--- a/tests/usr.bin/xlint/lint1/decl.exp        Sat Jul 10 19:29:28 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl.exp        Sat Jul 10 19:30:19 2021 +0000
@@ -8,3 +8,4 @@
 decl.c(68): warning: converting 'pointer to char' to incompatible 'pointer to double' for argument 1 [153]
 decl.c(70): warning: illegal combination of pointer (pointer to double) and integer (char), arg #1 [154]
 decl.c(72): warning: converting 'pointer to pointer to char' to incompatible 'pointer to double' for argument 1 [153]
+decl.c(80): error: syntax error '"' [249]



Home | Main Index | Thread Index | Old Index