aboutsummaryrefslogtreecommitdiff
path: root/tests/programs/embed_local_array.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 16:47:08 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 16:47:08 +0330
commit58c6edb92426852253d5f246e16710b636c93c70 (patch)
tree7230ee8829cc2c9de12add23460bbb024bec997f /tests/programs/embed_local_array.zc
parentglobals: an integer constant initializing a float or f32 global converts to f... (diff)
parentmerge work/jit2: x86-64 jit inline enhancements (diff)
Merge branch 'main' into work/spec
Diffstat (limited to 'tests/programs/embed_local_array.zc')
-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;
+}