]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/netbsd-tests/usr.bin/xlint/lint1/d_shift_to_narrower_type.c
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / netbsd-tests / usr.bin / xlint / lint1 / d_shift_to_narrower_type.c
1 // Test that type shifts that result to narrower types don't produce warnings.
2
3 void
4 foo(void) {
5         unsigned long l = 100;
6         unsigned long long ll = 100;
7         unsigned int i = 100;
8         unsigned short s = 100;
9         unsigned char c = 1;
10
11         l = ll >> 32;
12 //      i = ll >> 31;
13         i = ll >> 32;
14         s = ll >> 48;
15         c = ll >> 56;
16         s = i >> 16;
17         c = i >> 24;
18         c = s >> 8;
19         (void)≪
20         (void)&l;
21         (void)&i;
22         (void)&s;
23         (void)&c;
24 }