aboutsummaryrefslogtreecommitdiff
path: root/tests/iii/memory-no-std
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-27 13:27:14 +0000
committer_ov4 <ov4@ov4.org>2026-10-27 13:27:14 +0000
commit0dd0b0908300eee08a06ee51d9eb48b85fd97d74 (patch)
tree8e18df810a1d88f686f2b85ed2f05e3aa0985119 /tests/iii/memory-no-std
parent790e0fd7c5a81b9a27a6d84e0f3f4c7a0b17d04b (diff)
refactor(memory)!: move allocation functions into memory.cps
Route keyword NEW and DELETE through the same library runtime and retain allocation tracking, runtime diagnostics and exception behavior. BREAKING CHANGE: -no-std programs using NEW or DELETE must explicitly import memory.cps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/iii/memory-no-std')
-rw-r--r--tests/iii/memory-no-std/case.json27
-rw-r--r--tests/iii/memory-no-std/program.cps10
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/iii/memory-no-std/case.json b/tests/iii/memory-no-std/case.json
new file mode 100644
index 0000000..34a3e90
--- /dev/null
+++ b/tests/iii/memory-no-std/case.json
@@ -0,0 +1,27 @@
+{
+ "compiler_args": [
+ "-no-std"
+ ],
+ "errors": [
+ {
+ "reason": "Call to undefined function MALLOC",
+ "line": 6
+ },
+ {
+ "reason": "Call to undefined function REALLOC",
+ "line": 7
+ },
+ {
+ "reason": "Call to undefined function FREE",
+ "line": 8
+ },
+ {
+ "reason": "NEW/DELETE requires memory.cps",
+ "line": 9
+ },
+ {
+ "reason": "NEW/DELETE requires memory.cps",
+ "line": 10
+ }
+ ]
+}
diff --git a/tests/iii/memory-no-std/program.cps b/tests/iii/memory-no-std/program.cps
new file mode 100644
index 0000000..69941d6
--- /dev/null
+++ b/tests/iii/memory-no-std/program.cps
@@ -0,0 +1,10 @@
+CLASS Item
+ Value : INTEGER
+ENDCLASS
+TYPE Raw = C_TYPE("void*")
+DECLARE Obj : Item
+MALLOC(8)
+REALLOC((Raw)0, 8)
+FREE((Raw)0)
+Obj <- NEW Item()
+DELETE Obj