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.
This commit is contained in:
parent
e970c8c0da
commit
6262bf18d3
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: msg_219.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
|
||||
/* $NetBSD: msg_219.c,v 1.4 2022/02/27 18:57:16 rillig Exp $ */
|
||||
# 3 "msg_219.c"
|
||||
|
||||
|
||||
|
@ -10,3 +10,10 @@ char concat1[] = "one";
|
|||
char concat2[] = "one" "two"; /* expect: 219 */
|
||||
char concat3[] = "one" "two" "three"; /* expect: 219 */
|
||||
char concat4[] = "one" "two" "three" "four"; /* expect: 219 */
|
||||
|
||||
char concat4lines[] =
|
||||
"one"
|
||||
/* expect+1: warning: concatenated strings are illegal in traditional C [219] */
|
||||
"two"
|
||||
"three"
|
||||
"four";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
msg_219.c(10): warning: concatenated strings are illegal in traditional C [219]
|
||||
msg_219.c(11): warning: concatenated strings are illegal in traditional C [219]
|
||||
msg_219.c(12): warning: concatenated strings are illegal in traditional C [219]
|
||||
msg_219.c(17): warning: concatenated strings are illegal in traditional C [219]
|
||||
|
|
Loading…
Reference in New Issue