aboutsummaryrefslogtreecommitdiff
path: root/tests/iii
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-17 05:30:57 +0000
committer_ov4 <ov4@ov4.org>2026-10-17 05:30:57 +0000
commit4dd85fd6ecd9a67e5c2b68380873e6e114714355 (patch)
treeb9dad1d0845f4c2ae7e6efed171fbee40ccd1f31 /tests/iii
parente782898e420c7f2abd83b97c160194d0e70598dd (diff)
feat(memory): add tracked MALLOC and FREE builtins
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'tests/iii')
-rw-r--r--tests/iii/memory-call-arity/case.json8
-rw-r--r--tests/iii/memory-call-arity/notes.md5
-rw-r--r--tests/iii/memory-call-arity/program.cps1
-rw-r--r--tests/iii/memory-pointer-type/case.json8
-rw-r--r--tests/iii/memory-pointer-type/notes.md5
-rw-r--r--tests/iii/memory-pointer-type/program.cps4
-rw-r--r--tests/iii/memory-size-type/case.json8
-rw-r--r--tests/iii/memory-size-type/notes.md5
-rw-r--r--tests/iii/memory-size-type/program.cps1
9 files changed, 45 insertions, 0 deletions
diff --git a/tests/iii/memory-call-arity/case.json b/tests/iii/memory-call-arity/case.json
new file mode 100644
index 0000000..3159635
--- /dev/null
+++ b/tests/iii/memory-call-arity/case.json
@@ -0,0 +1,8 @@
+{
+ "errors": [
+ {
+ "reason": "FREE\\ expects\\ 1\\ arg",
+ "line": 1
+ }
+ ]
+}
diff --git a/tests/iii/memory-call-arity/notes.md b/tests/iii/memory-call-arity/notes.md
new file mode 100644
index 0000000..456445e
--- /dev/null
+++ b/tests/iii/memory-call-arity/notes.md
@@ -0,0 +1,5 @@
+# Rejection notes
+
+Human review: pending.
+
+The explicit memory builtin rejects the invalid argument before emitting a runtime call.
diff --git a/tests/iii/memory-call-arity/program.cps b/tests/iii/memory-call-arity/program.cps
new file mode 100644
index 0000000..2ae44d4
--- /dev/null
+++ b/tests/iii/memory-call-arity/program.cps
@@ -0,0 +1 @@
+FREE()
diff --git a/tests/iii/memory-pointer-type/case.json b/tests/iii/memory-pointer-type/case.json
new file mode 100644
index 0000000..557c4b9
--- /dev/null
+++ b/tests/iii/memory-pointer-type/case.json
@@ -0,0 +1,8 @@
+{
+ "errors": [
+ {
+ "reason": "Cannot\\ implicitly\\ convert",
+ "line": 4
+ }
+ ]
+}
diff --git a/tests/iii/memory-pointer-type/notes.md b/tests/iii/memory-pointer-type/notes.md
new file mode 100644
index 0000000..456445e
--- /dev/null
+++ b/tests/iii/memory-pointer-type/notes.md
@@ -0,0 +1,5 @@
+# Rejection notes
+
+Human review: pending.
+
+The explicit memory builtin rejects the invalid argument before emitting a runtime call.
diff --git a/tests/iii/memory-pointer-type/program.cps b/tests/iii/memory-pointer-type/program.cps
new file mode 100644
index 0000000..2c1abeb
--- /dev/null
+++ b/tests/iii/memory-pointer-type/program.cps
@@ -0,0 +1,4 @@
+TYPE Raw = C_TYPE("void*")
+TYPE P = ^INTEGER
+DECLARE Pointer : P
+FREE(Pointer)
diff --git a/tests/iii/memory-size-type/case.json b/tests/iii/memory-size-type/case.json
new file mode 100644
index 0000000..9753757
--- /dev/null
+++ b/tests/iii/memory-size-type/case.json
@@ -0,0 +1,8 @@
+{
+ "errors": [
+ {
+ "reason": "Allocation\\ size\\ must\\ be\\ INTEGER\\ or\\ a\\ C\\ integer",
+ "line": 1
+ }
+ ]
+}
diff --git a/tests/iii/memory-size-type/notes.md b/tests/iii/memory-size-type/notes.md
new file mode 100644
index 0000000..456445e
--- /dev/null
+++ b/tests/iii/memory-size-type/notes.md
@@ -0,0 +1,5 @@
+# Rejection notes
+
+Human review: pending.
+
+The explicit memory builtin rejects the invalid argument before emitting a runtime call.
diff --git a/tests/iii/memory-size-type/program.cps b/tests/iii/memory-size-type/program.cps
new file mode 100644
index 0000000..0215fef
--- /dev/null
+++ b/tests/iii/memory-size-type/program.cps
@@ -0,0 +1 @@
+MALLOC(1.5)