1
1
// Verifies that when compiling with -Zsanitizer=option,
2
2
// the `#[cfg(sanitize = "option")]` attribute is configured.
3
3
4
- // needs-sanitizer-support
5
4
// check-pass
6
5
// revisions: address cfi kcfi leak memory thread
7
6
//[address]needs-sanitizer-address
8
7
//[address]compile-flags: -Zsanitizer=address --cfg address
9
8
//[cfi]needs-sanitizer-cfi
10
9
//[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
13
12
//[leak]needs-sanitizer-leak
14
13
//[leak]compile-flags: -Zsanitizer=leak --cfg leak
15
14
//[memory]needs-sanitizer-memory
16
15
//[memory]compile-flags: -Zsanitizer=memory --cfg memory
17
16
//[thread]needs-sanitizer-thread
18
17
//[thread]compile-flags: -Zsanitizer=thread --cfg thread
19
18
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 { }
21
27
22
28
#[ cfg( all( sanitize = "address" , address) ) ]
23
29
fn main ( ) { }
@@ -36,3 +42,7 @@ fn main() {}
36
42
37
43
#[ cfg( all( sanitize = "thread" , thread) ) ]
38
44
fn main ( ) { }
45
+
46
+ fn check ( ) {
47
+ main ( ) ;
48
+ }
0 commit comments