aboutsummaryrefslogtreecommitdiff
path: root/tests/programs/embed_local_array.zc
blob: 0e2b7b881c18481ba6ba8257b97a1eebbf4db2f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
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;
}