aboutsummaryrefslogtreecommitdiff
path: root/tests/programs/embed_local_array.zc
diff options
context:
space:
mode:
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;
+}