xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_114.c (revision 2718af68c3efc72c9769069b5c7f9ed36f6b9def)
1 /*	$NetBSD: msg_114.c,v 1.4 2021/01/31 16:00:05 rillig Exp $	*/
2 # 3 "msg_114.c"
3 
4 // Test for message: %soperand of '%s' must be lvalue [114]
5 
6 void
7 example(int a)			/* expect: 231 */
8 {
9 	3++;			/* expect: 114 */
10 
11 	/*
12 	 * Before tree.c 1.137 from 2021-01-09, trying to increment an array
13 	 * aborted lint with 'common/tyname.c, 190: tspec_name(0)'.
14 	 *
15 	 * See msg_108.c for more details.
16 	 */
17 	"string"++;		/* expect: 108 */
18 
19 	(a + a)++;		/* expect: 114 */
20 }
21