aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test_increment_operators.sh
blob: f6aa2b518cc4af091bbb6b0b8fe871e27c13969e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
cat <<'EOF' > expected
44
44
46
46
44
42
42
EOF

test_diff <<'EOF'
int printf();

int main() {
    int a = 42;
    ++a;
    a++;
    printf("%d\n", a);
    printf("%d\n", a++);
    printf("%d\n", ++a);
    printf("%d\n", a);
    --a;
    a--;
    printf("%d\n", a--);
    printf("%d\n", --a);
    printf("%d\n", a);
}
EOF