2019-10-21 19:00:00 -05:00
|
|
|
// Verifies that when compiling with -Zsanitizer=option,
|
|
|
|
// the `#[cfg(sanitize = "option")]` attribute is configured.
|
|
|
|
|
|
|
|
// needs-sanitizer-support
|
2020-06-04 19:00:00 -05:00
|
|
|
// needs-sanitizer-address
|
2022-12-13 00:42:44 -06:00
|
|
|
// needs-sanitizer-cfi
|
|
|
|
// needs-sanitizer-kcfi
|
2020-06-04 19:00:00 -05:00
|
|
|
// needs-sanitizer-leak
|
|
|
|
// needs-sanitizer-memory
|
|
|
|
// needs-sanitizer-thread
|
2019-10-21 19:00:00 -05:00
|
|
|
// check-pass
|
|
|
|
// revisions: address leak memory thread
|
|
|
|
//[address]compile-flags: -Zsanitizer=address --cfg address
|
2022-12-13 00:42:44 -06:00
|
|
|
//[cfi]compile-flags: -Zsanitizer=cfi --cfg cfi
|
|
|
|
//[kcfi]compile-flags: -Zsanitizer=kcfi --cfg kcfi
|
2019-10-21 19:00:00 -05:00
|
|
|
//[leak]compile-flags: -Zsanitizer=leak --cfg leak
|
|
|
|
//[memory]compile-flags: -Zsanitizer=memory --cfg memory
|
|
|
|
//[thread]compile-flags: -Zsanitizer=thread --cfg thread
|
|
|
|
|
|
|
|
#![feature(cfg_sanitize)]
|
|
|
|
|
|
|
|
#[cfg(all(sanitize = "address", address))]
|
|
|
|
fn main() {}
|
|
|
|
|
2022-12-13 00:42:44 -06:00
|
|
|
#[cfg(all(sanitize = "cfi", cfi))]
|
|
|
|
fn main() {}
|
|
|
|
|
|
|
|
#[cfg(all(sanitize = "kcfi", kcfi))]
|
|
|
|
fn main() {}
|
|
|
|
|
2019-10-21 19:00:00 -05:00
|
|
|
#[cfg(all(sanitize = "leak", leak))]
|
|
|
|
fn main() {}
|
|
|
|
|
|
|
|
#[cfg(all(sanitize = "memory", memory))]
|
|
|
|
fn main() {}
|
|
|
|
|
|
|
|
#[cfg(all(sanitize = "thread", thread))]
|
|
|
|
fn main() {}
|