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
109//[cfi]compile-flags: -Zsanitizer=cfi --cfg cfi -Clto
11- //[kcfi]needs-sanitizer-kcfi
12- //[kcfi]compile-flags: -Zsanitizer=kcfi --cfg kcfi
10+ //[kcfi]needs-llvm-components: x86
11+ //[kcfi]compile-flags: -Zsanitizer=kcfi --cfg kcfi --target x86_64-unknown-none
1312//[leak]needs-sanitizer-leak
1413//[leak]compile-flags: -Zsanitizer=leak --cfg leak
1514//[memory]needs-sanitizer-memory
1615//[memory]compile-flags: -Zsanitizer=memory --cfg memory
1716//[thread]needs-sanitizer-thread
1817//[thread]compile-flags: -Zsanitizer=thread --cfg thread
1918
20- #![ feature( cfg_sanitize) ]
19+ #![ feature( cfg_sanitize, no_core, lang_items) ]
20+ #![ crate_type="lib" ]
21+ #![ no_core]
22+
23+ #[ lang="sized" ]
24+ trait Sized { }
25+ #[ lang="copy" ]
26+ trait Copy { }
2127
2228#[ cfg( all( sanitize = "address" , address) ) ]
2329fn main ( ) { }
@@ -36,3 +42,7 @@ fn main() {}
3642
3743#[ cfg( all( sanitize = "thread" , thread) ) ]
3844fn main ( ) { }
45+
46+ fn check ( ) {
47+ main ( ) ;
48+ }
0 commit comments