summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/alloc/too_large.rs
blob: 4e28d2401d79fa57ada0bc9d4d76f85d0c3f9567 (plain)
1
2
3
4
5
6
7
8
9
10
extern "Rust" {
    fn __rust_alloc(size: usize, align: usize) -> *mut u8;
}

fn main() {
    let bytes = isize::MAX as usize + 1;
    unsafe {
        __rust_alloc(bytes, 1); //~ERROR: larger than half the address space
    }
}