]> pd.if.org Git - lice/blob - tests/compound.c
autocommit for files dated 2014-11-17 20:13:34
[lice] / tests / compound.c
1 // compound assignment
2
3 int main(void) {
4     int a = 5;
5     expecti((a += 5), 10);
6     expecti((a -= 5), 5);
7     expecti((a *= 5), 25);
8     expecti((a /= 5), 5);
9     expecti((a %= 3), 2);
10
11     int b = 14;
12     expecti((b &= 7), 6);
13     expecti((b |= 8), 14);
14     expecti((b ^= 3), 13);
15     expecti((b <<= 2), 52);
16     expecti((b >>= 2), 13);
17
18     return 0;
19 }