]> git.lizzy.rs Git - rust.git/blob - src/test/ui/sanitize/cfg.rs
Rollup merge of #73292 - poliorcetics:fix-link-in-partialeq, r=Dylan-DPC
[rust.git] / src / test / ui / sanitize / cfg.rs
1 // Verifies that when compiling with -Zsanitizer=option,
2 // the `#[cfg(sanitize = "option")]` attribute is configured.
3
4 // needs-sanitizer-support
5 // needs-sanitizer-address
6 // needs-sanitizer-leak
7 // needs-sanitizer-memory
8 // needs-sanitizer-thread
9 // check-pass
10 // revisions: address leak memory thread
11 //[address]compile-flags: -Zsanitizer=address --cfg address
12 //[leak]compile-flags:    -Zsanitizer=leak    --cfg leak
13 //[memory]compile-flags:  -Zsanitizer=memory  --cfg memory
14 //[thread]compile-flags:  -Zsanitizer=thread  --cfg thread
15
16 #![feature(cfg_sanitize)]
17
18 #[cfg(all(sanitize = "address", address))]
19 fn main() {}
20
21 #[cfg(all(sanitize = "leak", leak))]
22 fn main() {}
23
24 #[cfg(all(sanitize = "memory", memory))]
25 fn main() {}
26
27 #[cfg(all(sanitize = "thread", thread))]
28 fn main() {}