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/d3cbbebc26c6
branches: trunk
changeset: 984520:d3cbbebc26c6
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 3be6644e3cbc -r d3cbbebc26c6 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 3be6644e3cbc -r d3cbbebc26c6 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