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/027_func_param_var.sy | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/sysy_lvX/027_func_param_var.sy (limited to 'tests/sysy_lvX/027_func_param_var.sy') diff --git a/tests/sysy_lvX/027_func_param_var.sy b/tests/sysy_lvX/027_func_param_var.sy new file mode 100644 index 0000000..8ea0326 --- /dev/null +++ b/tests/sysy_lvX/027_func_param_var.sy @@ -0,0 +1,40 @@ +void foo(int a) +{ + int b; + b = a; + a = b; + int c = b; + a = b; + c = a; +} + +int bar(int a, int b) +{ + int c; + c = b; + foo(c); + a = b; + b = c; + foo(27); + return c; +} + +int dummy() +{ + int a; + a = 16; + foo(a); + int b = 97, c; + c = bar(a, b); + foo(c); + foo(a); + b = bar(c, a); + return c; +} + +int main() +{ + int a; + a = dummy(); + return a; +} \ No newline at end of file -- cgit v1.2.3