]> git.lizzy.rs Git - rust.git/blob - src/test/ui/sanitize/badfree.rs
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[rust.git] / src / test / ui / sanitize / badfree.rs
1 // needs-sanitizer-support
2 // only-x86_64
3 //
4 // compile-flags: -Z sanitizer=address -O
5 //
6 // run-fail
7 // error-pattern: AddressSanitizer: SEGV
8
9 use std::ffi::c_void;
10
11 extern "C" {
12     fn free(ptr: *mut c_void);
13 }
14
15 fn main() {
16     unsafe {
17         free(1 as *mut c_void);
18     }
19 }