aboutsummaryrefslogtreecommitdiff
path: root/tests/sysy_lvX/036_prior_and_or.sy
blob: 3ec7cc6d3481b2443396e16d23c4676eec254064 (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
int main()
{
    int a = 4, b = 5, c = 5, d = 6;
    int e = 0;

    // (0 && 0) || 1
    if (a > b && b != c || c < d)
        e = e + 0x01;
    // 1 || (0 && 0)
    if (b >= c || a == d && 6 <= b)
        e = e + 0x02;

    // 1 || (0 && 0) || 0
    if (b || a != a && 1 != 2 || !3)
        e = e + 0x04;
    // 1 || (0 && 1) || 0
    if ((1) || a == 0 && 6 > b || b == c)
        e = e + 0x08;
    // 0 || (1 && 1) || 0
    if (b > c || (3) && 2 || 7 < 0)
        e = e + 0x10;
    // 0 || (1 && 0) || 0
    if (d >= 9 || 4 == a && 8 <= 5 || 2 > b)
        e = e + 0x20;

    // (0 && 0) || 1 || 1
    if (!b && 0 || a || (6))
        e = e + 0x40;
    // (1 && 1 && 1) || 0
    if (d > a && c <= b && d == 6 || 2 == 5)
        e = e + 0x80;

    return e;
}