]> git.lizzy.rs Git - rust.git/blob - src/test/ui-fulldeps/undef_mask.rs
Do not use Cortex-M0 since Qemu is too old
[rust.git] / src / test / ui-fulldeps / undef_mask.rs
1 // run-pass
2 // ignore-cross-compile
3 // ignore-stage1
4
5 #![feature(rustc_private)]
6
7 extern crate rustc;
8
9 use rustc::mir::interpret::UndefMask;
10 use rustc::ty::layout::Size;
11
12 fn main() {
13     let mut mask = UndefMask::new(Size::from_bytes(500), false);
14     assert!(!mask.get(Size::from_bytes(499)));
15     mask.set(Size::from_bytes(499), true);
16     assert!(mask.get(Size::from_bytes(499)));
17     mask.set_range_inbounds(Size::from_bytes(100), Size::from_bytes(256), true);
18     for i in 0..100 {
19         assert!(!mask.get(Size::from_bytes(i)));
20     }
21     for i in 100..256 {
22         assert!(mask.get(Size::from_bytes(i)));
23     }
24     for i in 256..499 {
25         assert!(!mask.get(Size::from_bytes(i)));
26     }
27 }