aboutsummaryrefslogtreecommitdiff
path: root/rcc-legacy/tests/sysy_lvX/loop_unroll5.sy
blob: 3204975c0def023cd684721710e71e2f8295515b (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
void test5(int n) {
    int i = 0, j = 0, k = 0, l = 0;
    int res = 0;
    
    i = 0;
    while (i < n) {
        j = 0;
        while (j < n) {
            k = 0;
            while (k < n) {
                l = 0;
                while (l < n) {
                    res = res + i + j + k + l;
                    l = l + 1;
                }
                k = k + 1;
            }
            j = j + 1;
        }
        i = i + 1;
    }
    putint(n);
    putch(10);
    putint(i);
    putch(10);
    putint(j);
    putch(10);
    putint(k);
    putch(10);
    putint(l);
    putch(10);
    putint(res);
    putch(10);
}

int main() {
    int i;
    i = -1;
    while (i < 10) {
        i = i + 1;
        test5(i);
    }
    return 0;
}