about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail-dep/libc/memrchr_null.rs
blob: a1d8fd663f88a2da6dee95559bbb562fe28bb77d (plain)
1
2
3
4
5
6
7
8
9
10
//@only-target: linux # `memrchr` is a GNU extension

use std::ptr;

// null is explicitly called out as UB in the C docs for `memchr`.
fn main() {
    unsafe {
        libc::memrchr(ptr::null(), 0, 0); //~ERROR: null pointer
    }
}