summaryrefslogtreecommitdiff
path: root/vaporize/tests
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-19 17:30:41 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-19 17:30:41 -0600
commit2f59e052e5272bb2833c91c84b89486bd1b5f592 (patch)
tree9c2eb9d96e7b6b00ac64eccd6f6b8c3eaa0a8419 /vaporize/tests
parent837dbf613bb571bac5c9e48ffe5865425e6b9fee (diff)
Create 'Kettle' class
Diffstat (limited to 'vaporize/tests')
-rw-r--r--vaporize/tests/ex30.vapor3
-rw-r--r--vaporize/tests/ex32.vapor15
-rw-r--r--vaporize/tests/ex32.vaporm22
3 files changed, 37 insertions, 3 deletions
diff --git a/vaporize/tests/ex30.vapor b/vaporize/tests/ex30.vapor
deleted file mode 100644
index 200baee..0000000
--- a/vaporize/tests/ex30.vapor
+++ /dev/null
@@ -1,3 +0,0 @@
-func Main()
-
- ret \ No newline at end of file
diff --git a/vaporize/tests/ex32.vapor b/vaporize/tests/ex32.vapor
new file mode 100644
index 0000000..8a8dc62
--- /dev/null
+++ b/vaporize/tests/ex32.vapor
@@ -0,0 +1,15 @@
+func Main()
+ t.3 = HeapAllocZ(4)
+ [t.3+0] = :functable_A
+ t.4 = [t.3+0]
+ t.5 = [t.4+0]
+ t.6 = 12
+ t.10 = call t.5(t.3 t.6)
+ PrintIntS(t.10)
+ ret
+
+const functable_A
+ :A_foo
+
+func A_foo(this t.1)
+ ret t.1
diff --git a/vaporize/tests/ex32.vaporm b/vaporize/tests/ex32.vaporm
new file mode 100644
index 0000000..85ecf13
--- /dev/null
+++ b/vaporize/tests/ex32.vaporm
@@ -0,0 +1,22 @@
+func Main [in 0, out 0, local 0]
+ $t0 = HeapAllocZ(4)
+ [$t0] = :functable_A
+ $t1 = [$t0]
+ $t2 = [$t1]
+ $a0 = $t0
+ $a1 = 12
+ call $t2
+ $t1 = $v0
+ PrintIntS($t1)
+ ret
+
+const functable_A
+ :A_foo
+
+func A_foo [in 0, out 0, local 1]
+ local[0] = $s0
+ $t0 = $a0
+ $s0 = $a1
+ $v0 = $s0
+ $s0 = local[0]
+ ret