]> pd.if.org Git - lice/blob - tests/bitwise.c
autocommit for files dated 2014-11-17 20:13:34
[lice] / tests / bitwise.c
1 // bitwise operators
2
3 int main(void) {
4     expecti(1 | 2, 3);
5     expecti(2 | 5, 7);
6     expecti(2 | 7, 7);
7
8     expecti(1 & 2, 0);
9     expecti(2 & 7, 2);
10
11     expecti(~0, -1);
12     expecti(~2, -3);
13     expecti(~-1, 0);
14
15     expecti(15 ^ 5, 10);
16
17     expecti(1  << 4, 16);
18     expecti(3  << 4, 48);
19     expecti(15 >> 3, 1);
20     expecti(8  >> 2, 2);
21
22     return 0;
23 }