aboutsummaryrefslogtreecommitdiff
path: root/tests/programs/zc0embed_write.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 17:00:26 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 17:00:26 +0330
commitff16b77d03c997ac4214b5a440c83cd849be7a2d (patch)
tree159dd6fc86dbb3dfc0381f109681751085011c77 /tests/programs/zc0embed_write.zc
parentlen: len on a char* is an error with typecheck off too (appendix b.2.14) (diff)
parentmerge work/xref: zc0 u*d redo and follow-ups (diff)
Merge branch 'main' into work/spec
Diffstat (limited to 'tests/programs/zc0embed_write.zc')
-rw-r--r--tests/programs/zc0embed_write.zc9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/programs/zc0embed_write.zc b/tests/programs/zc0embed_write.zc
new file mode 100644
index 0000000..09686b5
--- /dev/null
+++ b/tests/programs/zc0embed_write.zc
@@ -0,0 +1,9 @@
+include rt;
+// zc0 keeps a local embed array in the code, so it refuses a store into one; the
+// resident compiler accepts it (prints 9). tests/test.sh checks zc0's message.
+fn main() {
+ embed "tests/data/embed/bytes.bin" as u8[] b;
+ b[1] = 9;
+ rt.put_n(b[1]); rt.put_c(10);
+ return 0;
+}