aboutsummaryrefslogtreecommitdiff
path: root/rcc-legacy/tests/sysy_lvX/loop_unroll3.sy
blob: e69f3933e4283f22a10bcc15b7957053dc0dad8d (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
int pure(int n) {
    return n * 2 + 1;
}

void test(int n) {
    int i, j, k;
    
    j = 0;
    i = 0;
    while (i <= 0) {
        j = j + i;
        i = i + 1;
    }
    putint(j);
    putch(10);
}

int main() {
    test(-1);
    test(0);
    test(1);
    test(2);
    test(100);
    test(101);
    return 0;
}