From 72af0dedf9e18911da65b9a5c4906689e868d9fc Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Mon, 8 Jun 2026 17:10:31 +0800 Subject: [legacy] Add functional and performance test suites --- rcc-legacy/tests/functional/try_fold_lhs.sy | 78 +++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 rcc-legacy/tests/functional/try_fold_lhs.sy (limited to 'rcc-legacy/tests/functional/try_fold_lhs.sy') diff --git a/rcc-legacy/tests/functional/try_fold_lhs.sy b/rcc-legacy/tests/functional/try_fold_lhs.sy new file mode 100644 index 0000000..b12a2e6 --- /dev/null +++ b/rcc-legacy/tests/functional/try_fold_lhs.sy @@ -0,0 +1,78 @@ +int f() { + return 233; +} + +int g1() { + int a = f(); + int b = a + 456; + int c = b + 123; + return c; +} + +int g2() { + int a = f(); + int b = a + 456; + int c = b - 123; + return c; +} + +int g3() { + int a = f(); + int b = a + 456; + int c = 123 - b; + return c; +} + +int g4() { + int a = f(); + int b = a - 456; + int c = b + 123; + return c; +} + +int g5() { + int a = f(); + int b = a - 456; + int c = b - 123; + return c; +} + +int g6() { + int a = f(); + int b = a - 456; + int c = 123 - b; + return c; +} + +int g7() { + int a = f(); + int b = 456 - a; + int c = b + 123; + return c; +} + +int g8() { + int a = f(); + int b = 456 - a; + int c = b - 123; + return c; +} + +int g9() { + int a = f(); + int b = 456 - a; + int c = 123 - b; + return c; +} + +int main() { + putint(g1()); putch(10); + putint(g2()); putch(10); + putint(g3()); putch(10); + putint(g4()); putch(10); + putint(g5()); putch(10); + putint(g6()); putch(10); + putint(g7()); putch(10); + putint(g8()); putch(10); + putint(g9()); putch(10); +} \ No newline at end of file -- cgit v1.2.3