mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 03:33:59 +00:00
6d75f54310
Moves the sanitizer ui tests to the sanitizer directory and removes the sanitizer prefix from tests file names similarly to how the sanitizer codegen tests are organized.
21 lines
377 B
Rust
21 lines
377 B
Rust
//@ 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);
|
|
}
|
|
}
|