From a5f03936e01a2b0d752083d6bfa410f3f8a37105 Mon Sep 17 00:00:00 2001 From: Jamie Willis <j.willis19@imperial.ac.uk> Date: Sun, 19 Jan 2025 17:46:06 +0000 Subject: [PATCH] added clashNames example --- .../function/simple_functions/clashNames.wacc | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 valid/function/simple_functions/clashNames.wacc diff --git a/valid/function/simple_functions/clashNames.wacc b/valid/function/simple_functions/clashNames.wacc new file mode 100644 index 0000000..f613ccb --- /dev/null +++ b/valid/function/simple_functions/clashNames.wacc @@ -0,0 +1,21 @@ +# we should be able to use any function names, even if they clash with libc + +# Output: + +# Exit: +# 101 + +# Program: + +begin + int malloc() is return 42 end + int scanf() is return 37 end + int printf() is return 20 end + int puts() is return 2 end + + int u = call malloc(); + int x = call scanf(); + int y = call printf(); + int z = call puts(); + exit (u + x + y + z) +end -- GitLab