1*1f5207b7SJohn Levon typedef unsigned short __attribute__((bitwise))__le16;
foo(__le16 a)2*1f5207b7SJohn Levon static __le16 foo(__le16 a)
3*1f5207b7SJohn Levon {
4*1f5207b7SJohn Levon 	return a |= ~a;
5*1f5207b7SJohn Levon }
6*1f5207b7SJohn Levon 
baz(__le16 a)7*1f5207b7SJohn Levon static int baz(__le16 a)
8*1f5207b7SJohn Levon {
9*1f5207b7SJohn Levon 	return ~a == ~a;
10*1f5207b7SJohn Levon }
11*1f5207b7SJohn Levon 
barf(__le16 a)12*1f5207b7SJohn Levon static int barf(__le16 a)
13*1f5207b7SJohn Levon {
14*1f5207b7SJohn Levon 	return a == (a & ~a);
15*1f5207b7SJohn Levon }
16*1f5207b7SJohn Levon 
bar(__le16 a)17*1f5207b7SJohn Levon static __le16 bar(__le16 a)
18*1f5207b7SJohn Levon {
19*1f5207b7SJohn Levon 	return -a;
20*1f5207b7SJohn Levon }
21*1f5207b7SJohn Levon 
22*1f5207b7SJohn Levon /*
23*1f5207b7SJohn Levon  * check-name: foul bitwise
24*1f5207b7SJohn Levon  * check-error-start
25*1f5207b7SJohn Levon foul-bitwise.c:9:16: warning: restricted __le16 degrades to integer
26*1f5207b7SJohn Levon foul-bitwise.c:9:22: warning: restricted __le16 degrades to integer
27*1f5207b7SJohn Levon foul-bitwise.c:19:16: warning: restricted __le16 degrades to integer
28*1f5207b7SJohn Levon foul-bitwise.c:19:16: warning: incorrect type in return expression (different base types)
29*1f5207b7SJohn Levon foul-bitwise.c:19:16:    expected restricted __le16
30*1f5207b7SJohn Levon foul-bitwise.c:19:16:    got int
31*1f5207b7SJohn Levon  * check-error-end
32*1f5207b7SJohn Levon  */
33