summaryrefslogtreecommitdiff
path: root/tests/math_assignment.c
blob: abc295e0aabb45e8c4ae8a1213a264b25a24e097 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
int positive_test() {
    int x = 0;
    x += 5;//5
    x -= 2;//3
    x *= 9;//27 0x1b
    x /= 2;//13 0xd

    x %= 7;//6
    x |= 8;//14 0xe
    x ^= 3;//13 0xd

    x += 2 << 3;//13 + 16 = 29 0xd
    x -= 4 >> 1;//29 - 2 = 27 0x1b
    x &= 7;//3
    x <<= 5;//96 0x60
    x >>= 5;//3
    return x;
}

int main(){
    return positive_test();
}