summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_controll.tnsl12
-rw-r--r--tests/test_funcall_2.tnsl12
-rw-r--r--tests/test_funcall_3.tnsl16
3 files changed, 40 insertions, 0 deletions
diff --git a/tests/test_controll.tnsl b/tests/test_controll.tnsl
new file mode 100644
index 0000000..47ff241
--- /dev/null
+++ b/tests/test_controll.tnsl
@@ -0,0 +1,12 @@
+/; main [int]
+
+ /; if (false)
+ return 1
+ ;; else if (1 == 0)
+ return 2
+ ;; else
+ return 69
+ ;/
+
+ return 0
+;/
diff --git a/tests/test_funcall_2.tnsl b/tests/test_funcall_2.tnsl
new file mode 100644
index 0000000..3bf746c
--- /dev/null
+++ b/tests/test_funcall_2.tnsl
@@ -0,0 +1,12 @@
+/; ret_a [int]
+ return 9
+;/
+
+/; ret_b (int i, j) [int]
+ return i + j
+;/
+
+/; main [int]
+ int i = ret_a()
+ return ret_b(60, i)
+;/
diff --git a/tests/test_funcall_3.tnsl b/tests/test_funcall_3.tnsl
new file mode 100644
index 0000000..b974ea7
--- /dev/null
+++ b/tests/test_funcall_3.tnsl
@@ -0,0 +1,16 @@
+struct Str {
+ int i, j
+}
+
+/; strout [Str]
+ Str out
+ out.i = 60
+ out.j = 9
+ return out
+;/
+
+/; main [int]
+ Str out
+ out = strout()
+ return out.j + out.i
+;/