msg_121.c revision 1.7
1/*	$NetBSD: msg_121.c,v 1.7 2023/07/07 19:45:22 rillig Exp $	*/
2# 3 "msg_121.c"
3
4// Test for message: negative shift [121]
5
6/* lint1-extra-flags: -X 351 */
7
8int
9example(int x)
10{
11	/* expect+1: warning: negative shift [121] */
12	return x << (3 - 5);
13}
14
15void /*ARGSUSED*/
16shift_by_double(int x, double amount)
17{
18	/*
19	 * This is already caught by typeok_scalar, so it doesn't reach
20	 * typeok_shift via typeok_op.
21	 */
22	/* expect+1: error: operands of '<<' have incompatible types 'int' and 'double' [107] */
23	return x << amount;
24}
25