Module Name:    src
Committed By:   rillig
Date:           Sat Jan  9 15:32:06 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: msg_160.c msg_160.exp

Log Message:
lint: add test for message 160


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_160.c \
    src/tests/usr.bin/xlint/lint1/msg_160.exp

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/msg_160.c
diff -u src/tests/usr.bin/xlint/lint1/msg_160.c:1.1 src/tests/usr.bin/xlint/lint1/msg_160.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_160.c:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_160.c	Sat Jan  9 15:32:06 2021
@@ -1,7 +1,13 @@
-/*	$NetBSD: msg_160.c,v 1.1 2021/01/02 10:22:43 rillig Exp $	*/
+/*	$NetBSD: msg_160.c,v 1.2 2021/01/09 15:32:06 rillig Exp $	*/
 # 3 "msg_160.c"
 
 // Test for message: operator '==' found where '=' was expected [160]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -h */
+
+_Bool
+both_equal_or_unequal(int a, int b, int c, int d)
+{
+	/* XXX: Why shouldn't this be legitimate? */
+	return (a == b) == (c == d);
+}
Index: src/tests/usr.bin/xlint/lint1/msg_160.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_160.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_160.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_160.exp:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_160.exp	Sat Jan  9 15:32:06 2021
@@ -1 +1,2 @@
-msg_160.c(6): syntax error ':' [249]
+msg_160.c(12): warning: operator '==' found where '=' was expected [160]
+msg_160.c(12): warning: operator '==' found where '=' was expected [160]

Reply via email to