aboutsummaryrefslogtreecommitdiff
path: root/test/data/nested-fns.yx
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-07-08 23:30:36 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-07-08 23:30:36 +0200
commit71fb62d896ac3d34d86636123470f09482821add (patch)
treeb09f9027f3f52cda7ad11e029fa33c90b87d030b /test/data/nested-fns.yx
parent81298346f1e512b0537a2063b390ebfc920c3f04 (diff)
Add some basic LLVM IR tests
Diffstat (limited to 'test/data/nested-fns.yx')
-rw-r--r--test/data/nested-fns.yx13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/data/nested-fns.yx b/test/data/nested-fns.yx
new file mode 100644
index 0000000..3f60f5b
--- /dev/null
+++ b/test/data/nested-fns.yx
@@ -0,0 +1,13 @@
+fn1 :: () int {
+ /* You can create and use nested functions */
+ fn2 :: () int {
+ return fn1() * fn1();
+
+ /* Nested functions shadow parent functions */
+ fn1 :: () int {
+ return 42;
+ }
+ }
+
+ return fn2();
+}