]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/vec-fixed-length.rs
Remove the in-tree `flate` crate
[rust.git] / src / test / run-pass / vec-fixed-length.rs
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11
12 use std::mem::size_of;
13
14 #[cfg(not(target_pointer_width = "64"))]
15 fn test_big_vec() {}
16
17 #[cfg(target_pointer_width = "64")]
18 fn test_big_vec()
19 {
20     assert_eq!(size_of::<[u8; (1 << 32)]>(), (1 << 32));
21 }
22
23 fn main() {
24     let x: [isize; 4] = [1, 2, 3, 4];
25     assert_eq!(x[0], 1);
26     assert_eq!(x[1], 2);
27     assert_eq!(x[2], 3);
28     assert_eq!(x[3], 4);
29
30     assert_eq!(size_of::<[u8; 4]>(), 4);
31     test_big_vec();
32 }