tests/lint: test where exactly lint complains about concatenation This only applies to traditional C and ensures that the behavior is preserved when rearranging the C parser to evaluate string concatenation from left to right.diff -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_219.c
(rillig)
--- src/tests/usr.bin/xlint/lint1/msg_219.c 2021/01/31 11:12:07 1.3
+++ src/tests/usr.bin/xlint/lint1/msg_219.c 2022/02/27 18:57:16 1.4
@@ -1,12 +1,19 @@ | @@ -1,12 +1,19 @@ | |||
1 | /* $NetBSD: msg_219.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */ | 1 | /* $NetBSD: msg_219.c,v 1.4 2022/02/27 18:57:16 rillig Exp $ */ | |
2 | # 3 "msg_219.c" | 2 | # 3 "msg_219.c" | |
3 | 3 | |||
4 | 4 | |||
5 | /* Test for message: concatenated strings are illegal in traditional C [219] */ | 5 | /* Test for message: concatenated strings are illegal in traditional C [219] */ | |
6 | 6 | |||
7 | /* lint1-flags: -t -w */ | 7 | /* lint1-flags: -t -w */ | |
8 | 8 | |||
9 | char concat1[] = "one"; | 9 | char concat1[] = "one"; | |
10 | char concat2[] = "one" "two"; /* expect: 219 */ | 10 | char concat2[] = "one" "two"; /* expect: 219 */ | |
11 | char concat3[] = "one" "two" "three"; /* expect: 219 */ | 11 | char concat3[] = "one" "two" "three"; /* expect: 219 */ | |
12 | char concat4[] = "one" "two" "three" "four"; /* expect: 219 */ | 12 | char concat4[] = "one" "two" "three" "four"; /* expect: 219 */ | |
13 | ||||
14 | char concat4lines[] = | |||
15 | "one" | |||
16 | /* expect+1: warning: concatenated strings are illegal in traditional C [219] */ | |||
17 | "two" | |||
18 | "three" | |||
19 | "four"; |
--- src/tests/usr.bin/xlint/lint1/Attic/msg_219.exp 2021/03/28 15:36:37 1.3
+++ src/tests/usr.bin/xlint/lint1/Attic/msg_219.exp 2022/02/27 18:57:16 1.4
@@ -1,3 +1,4 @@ | @@ -1,3 +1,4 @@ | |||
1 | msg_219.c(10): warning: concatenated strings are illegal in traditional C [219] | 1 | msg_219.c(10): warning: concatenated strings are illegal in traditional C [219] | |
2 | msg_219.c(11): warning: concatenated strings are illegal in traditional C [219] | 2 | msg_219.c(11): warning: concatenated strings are illegal in traditional C [219] | |
3 | msg_219.c(12): warning: concatenated strings are illegal in traditional C [219] | 3 | msg_219.c(12): warning: concatenated strings are illegal in traditional C [219] | |
4 | msg_219.c(17): warning: concatenated strings are illegal in traditional C [219] |