1 /* $NetBSD: msg_118_ilp32.c,v 1.1 2025/09/06 20:18:41 rillig Exp $ */ 2 # 3 "msg_118_ilp32.c" 3 4 /* Test for message: '%s' %s '%s' differs between traditional C and C90 [118] */ 5 6 /* lint1-flags: -hw -X 351 */ 7 /* lint1-only-if: ilp32 */ 8 9 int si; 10 unsigned ui; 11 long sl; 12 unsigned long ul; 13 14 /* 15 * On 32-bit platforms both operands of the '<<' operator are first promoted 16 * individually, and since C90 does not know 'long long', the maximum 17 * bit-size for an integer type is 32 bits. 18 */ 19 void 20 test_shl(void) 21 { 22 si <<= si; 23 si <<= ui; 24 si <<= sl; 25 si <<= ul; 26 27 si = si << si; 28 si = si << ui; 29 si = si << sl; 30 si = si << ul; 31 } 32 33 void 34 test_shr(void) 35 { 36 si >>= si; 37 si >>= ui; 38 si >>= sl; 39 si >>= ul; 40 41 si = si >> si; 42 /* expect+1: warning: 'int' >> 'unsigned int' differs between traditional C and C90 [118] */ 43 si = si >> ui; 44 si = si >> sl; 45 /* expect+1: warning: 'int' >> 'unsigned long' differs between traditional C and C90 [118] */ 46 si = si >> ul; 47 } 48