diff options
Diffstat (limited to 'tests/iii/memory-no-std')
| -rw-r--r-- | tests/iii/memory-no-std/case.json | 27 | ||||
| -rw-r--r-- | tests/iii/memory-no-std/program.cps | 10 |
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 |
