aboutsummaryrefslogtreecommitdiff
path: root/tests/programs
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 16:35:53 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 16:35:53 +0330
commit6cca028ab8d2f87e7005b8760afde0a8a71a023b (patch)
tree6bf1aa84621374d0ba0bf95a12e0097aeb326688 /tests/programs
parentmerge bounds checking (diff)
parenttodo: zc0 gaps done (diff)
merge work/xref: zc0 gaps a-f
Diffstat (limited to 'tests/programs')
-rw-r--r--tests/programs/embed_local_array.zc11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/programs/embed_local_array.zc b/tests/programs/embed_local_array.zc
new file mode 100644
index 0000000..0e2b7b8
--- /dev/null
+++ b/tests/programs/embed_local_array.zc
@@ -0,0 +1,11 @@
+include rt;
+// embed of an array type inside a function (zc0 used to embed arrays only at the top level)
+fn main() {
+ embed "tests/data/embed/bytes.bin" as u8[] bytes;
+ embed "tests/data/embed/bytes.bin" as i8[8] signed;
+ embed "tests/data/embed/shorts.bin" as u16[] shorts;
+ rt.put_n(bytes[4]); rt.put_c(32);
+ rt.put_n(signed[4]); rt.put_c(32); rt.put_n(signed[7]); rt.put_c(32);
+ rt.put_n(shorts[0] + shorts[1] * 10 + shorts[2] * 100); rt.put_c(10);
+ return 0;
+}