11// Verifies that when compiling with -Zsanitizer=option,
22// the `#[cfg(sanitize = "option")]` attribute is configured.
33
4- // needs-sanitizer-support
54// check-pass
65// revisions: address cfi kcfi leak memory thread
76//[address]needs-sanitizer-address
87//[address]compile-flags: -Zsanitizer=address --cfg address
98//[cfi]needs-sanitizer-cfi
10- //[cfi]compile-flags: -Zsanitizer=cfi --cfg cfi -Clto
11- //[kcfi]needs-sanitizer-kcfi
12- //[kcfi]compile-flags: -Zsanitizer=kcfi --cfg kcfi
9+ //[cfi]compile-flags: -Zsanitizer=cfi --cfg cfi
10+ //[cfi]compile-flags: -Clto -Ccodegen-units=1 -Ctarget-feature=-crt-static
11+ //[kcfi]needs-llvm-components: x86
12+ //[kcfi]compile-flags: -Zsanitizer=kcfi --cfg kcfi --target x86_64-unknown-none
1313//[leak]needs-sanitizer-leak
1414//[leak]compile-flags: -Zsanitizer=leak --cfg leak
1515//[memory]needs-sanitizer-memory
1616//[memory]compile-flags: -Zsanitizer=memory --cfg memory
1717//[thread]needs-sanitizer-thread
1818//[thread]compile-flags: -Zsanitizer=thread --cfg thread
1919
20- #![ feature( cfg_sanitize) ]
20+ #![ feature( cfg_sanitize, no_core, lang_items) ]
21+ #![ crate_type="lib" ]
22+ #![ no_core]
23+
24+ #[ lang="sized" ]
25+ trait Sized { }
26+ #[ lang="copy" ]
27+ trait Copy { }
2128
2229#[ cfg( all( sanitize = "address" , address) ) ]
2330fn main ( ) { }
@@ -36,3 +43,7 @@ fn main() {}
3643
3744#[ cfg( all( sanitize = "thread" , thread) ) ]
3845fn main ( ) { }
46+
47+ pub fn check ( ) {
48+ main ( ) ;
49+ }
0 commit comments