diff options
Diffstat (limited to 'tests/sysy_lvX/036_prior_and_or.sy')
| -rw-r--r-- | tests/sysy_lvX/036_prior_and_or.sy | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/sysy_lvX/036_prior_and_or.sy b/tests/sysy_lvX/036_prior_and_or.sy new file mode 100644 index 0000000..3ec7cc6 --- /dev/null +++ b/tests/sysy_lvX/036_prior_and_or.sy @@ -0,0 +1,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; +}
\ No newline at end of file |
