op_shl_lp64.c revision 1.1 1 /* $NetBSD: op_shl_lp64.c,v 1.1 2021/07/04 20:22:31 rillig Exp $ */
2 # 3 "op_shl_lp64.c"
3
4 /*
5 * Test overflow on shl of 128-bit integers, as seen in
6 * ecp_nistp256.c(296).
7 */
8
9 /* lint1-only-if lp64 */
10
11 const __uint128_t zero105 =
12 /* FIXME: 105 is ok for __uint128_t */
13 /* expect+1: warning: shift amount 105 is greater than bit-size 32 of 'int' [122] */
14 (((__uint128_t)1) << 105)
15 /* FIXME: 41 is ok for __uint128_t */
16 /* expect+1: warning: shift amount 41 is greater than bit-size 32 of 'int' [122] */
17 - (((__uint128_t)1) << 41)
18 - (((__uint128_t)1) << 9);
19