aboutsummaryrefslogtreecommitdiff
path: root/rcc-legacy/tests/sysy_lvX/036_prior_and_or.sy
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-06-08 17:10:31 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-06-08 17:10:31 +0800
commit72af0dedf9e18911da65b9a5c4906689e868d9fc (patch)
tree2ecbad93f96ab8ad7e26dc02cd02d802f853ab97 /rcc-legacy/tests/sysy_lvX/036_prior_and_or.sy
parent8faf6d290d6703b1775e0ad7a8928a4ebea4b11b (diff)
downloadrcc-project-72af0dedf9e18911da65b9a5c4906689e868d9fc.tar.gz
rcc-project-72af0dedf9e18911da65b9a5c4906689e868d9fc.tar.xz
[legacy] Add functional and performance test suites
Diffstat (limited to 'rcc-legacy/tests/sysy_lvX/036_prior_and_or.sy')
-rw-r--r--rcc-legacy/tests/sysy_lvX/036_prior_and_or.sy34
1 files changed, 34 insertions, 0 deletions
diff --git a/rcc-legacy/tests/sysy_lvX/036_prior_and_or.sy b/rcc-legacy/tests/sysy_lvX/036_prior_and_or.sy
new file mode 100644
index 0000000..3ec7cc6
--- /dev/null
+++ b/rcc-legacy/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