1 #[link(name = "test", kind = "static")]
3 fn slice_len(s: &[u8]) -> usize;
4 fn slice_elem(s: &[u8], idx: usize) -> u8;
8 let data = [1, 2, 3, 4, 5];
11 assert_eq!(data.len(), slice_len(&data) as usize);
12 assert_eq!(data[0], slice_elem(&data, 0));
13 assert_eq!(data[1], slice_elem(&data, 1));
14 assert_eq!(data[2], slice_elem(&data, 2));
15 assert_eq!(data[3], slice_elem(&data, 3));
16 assert_eq!(data[4], slice_elem(&data, 4));