blob: ecbb58eba00d406a435ec1d13520cf83000dc1c8 [file] [log] [blame] [edit]
//@ needs-sanitizer-support
//@ needs-sanitizer-address
//@ ignore-cross-compile
//
//@ compile-flags: -Z sanitizer=address -O
//
//@ run-fail
//@ regex-error-pattern: AddressSanitizer: (SEGV|attempting free on address which was not malloc)
use std::ffi::c_void;
extern "C" {
fn free(ptr: *mut c_void);
}
fn main() {
unsafe {
free(1 as *mut c_void);
}
}