Module Name:    src
Committed By:   rillig
Date:           Fri Apr  9 16:37:18 UTC 2021

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

Log Message:
tests/lint: test bit-shift amount equal to the type's width


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_267.c \
    src/tests/usr.bin/xlint/lint1/msg_267.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_267.c
diff -u src/tests/usr.bin/xlint/lint1/msg_267.c:1.2 src/tests/usr.bin/xlint/lint1/msg_267.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_267.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_267.c	Fri Apr  9 16:37:18 2021
@@ -1,7 +1,16 @@
-/*	$NetBSD: msg_267.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_267.c,v 1.3 2021/04/09 16:37:18 rillig Exp $	*/
 # 3 "msg_267.c"
 
 // Test for message: shift equal to size of object [267]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+int
+shr32(unsigned int x)
+{
+	return x >> 32;		/* expect: 267 */
+}
+
+int
+shl32(unsigned int x)
+{
+	return x << 32;		/* expect: 267 */
+}
Index: src/tests/usr.bin/xlint/lint1/msg_267.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_267.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_267.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_267.exp:1.2	Sun Mar 21 20:45:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_267.exp	Fri Apr  9 16:37:18 2021
@@ -1 +1,2 @@
-msg_267.c(6): error: syntax error ':' [249]
+msg_267.c(9): warning: shift equal to size of object [267]
+msg_267.c(15): warning: shift equal to size of object [267]

Reply via email to