xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_121.c (revision 82d56013d7b633d116a93943de88e08335357a7c)
1 /*	$NetBSD: msg_121.c,v 1.4 2021/04/06 21:44:12 rillig Exp $	*/
2 # 3 "msg_121.c"
3 
4 // Test for message: negative shift [121]
5 
6 int
7 example(int x)
8 {
9 	return x << (3 - 5);		/* expect: 121 */
10 }
11 
12 void /*ARGSUSED*/
13 shift_by_double(int x, double amount)
14 {
15 	/*
16 	 * This is already caught by typeok_scalar, so it doesn't reach
17 	 * typeok_shift via typeok_op.
18 	 */
19 	return x << amount;		/* expect: incompatible types */
20 }
21