Module Name: src
Committed By: rillig
Date: Tue Jun 29 07:28:02 UTC 2021
Modified Files:
src/tests/usr.bin/xlint/lint1: lex_char.c
Log Message:
tests/lint: add test for character constant using backslash-newline
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/lex_char.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/xlint/lint1/lex_char.c
diff -u src/tests/usr.bin/xlint/lint1/lex_char.c:1.3 src/tests/usr.bin/xlint/lint1/lex_char.c:1.4
--- src/tests/usr.bin/xlint/lint1/lex_char.c:1.3 Tue Jun 29 07:17:43 2021
+++ src/tests/usr.bin/xlint/lint1/lex_char.c Tue Jun 29 07:28:01 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_char.c,v 1.3 2021/06/29 07:17:43 rillig Exp $ */
+/* $NetBSD: lex_char.c,v 1.4 2021/06/29 07:28:01 rillig Exp $ */
# 3 "lex_char.c"
/*
@@ -58,3 +58,14 @@ test(void)
/* U+000D carriage return */
sink('\r');
}
+
+/*
+ * Even though backslash-newline is not supported by C99, lint accepts it
+ * in any mode, even for traditional C.
+ */
+char ch = '\
+\
+\
+\
+\
+x';