blob: d606d71cba02df18f9958d414bc75ce0ee8c9016 [file] [log] [blame] [edit]
//@ needs-sanitizer-support
//@ needs-sanitizer-realtime
//
//@ compile-flags: -Z sanitizer=realtime
//@ exec-env: RTSAN_OPTIONS=abort_on_error=0
//
//@ run-fail
//@ error-pattern: RealtimeSanitizer: blocking-call
//@ ignore-backends: gcc
#![feature(sanitize)]
#[sanitize(realtime = "nonblocking")]
fn sanitizer_on() {
caller();
}
fn caller() {
blocking()
}
#[sanitize(realtime = "blocking")]
fn blocking() {
println!("blocking call not detected");
}
fn main() {
sanitizer_on();
}