From 4022e5c95210631e4aceb08eaf9d9071aa5aefc4 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Tue, 15 Sep 2026 08:16:43 +0800 Subject: Set up a git repo --- tests/sysy_lvX/036_prior_and_or.sy | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/sysy_lvX/036_prior_and_or.sy (limited to 'tests/sysy_lvX/036_prior_and_or.sy') 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 -- cgit v1.2.3