diff options
| author | Richard Qin <richard.qin.001@gmail.com> | 2026-09-15 08:16:43 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.001@gmail.com> | 2026-09-15 08:16:43 +0800 |
| commit | 4022e5c95210631e4aceb08eaf9d9071aa5aefc4 (patch) | |
| tree | a5922559836e45fb3459a3d070367912e1035b1a /tests/performance/24_try_fold_lhs.sy | |
| download | rcc-4022e5c95210631e4aceb08eaf9d9071aa5aefc4.tar.gz rcc-4022e5c95210631e4aceb08eaf9d9071aa5aefc4.tar.xz | |
Diffstat (limited to 'tests/performance/24_try_fold_lhs.sy')
| -rw-r--r-- | tests/performance/24_try_fold_lhs.sy | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/performance/24_try_fold_lhs.sy b/tests/performance/24_try_fold_lhs.sy new file mode 100644 index 0000000..d2ff3d0 --- /dev/null +++ b/tests/performance/24_try_fold_lhs.sy @@ -0,0 +1,79 @@ +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); + return 0; +}
\ No newline at end of file |
