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
- //[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
13
13
//[leak]needs-sanitizer-leak
14
14
//[leak]compile-flags: -Zsanitizer=leak --cfg leak
15
15
//[memory]needs-sanitizer-memory
16
16
//[memory]compile-flags: -Zsanitizer=memory --cfg memory
17
17
//[thread]needs-sanitizer-thread
18
18
//[thread]compile-flags: -Zsanitizer=thread --cfg thread
19
19
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 { }
21
28
22
29
#[ cfg( all( sanitize = "address" , address) ) ]
23
30
fn main ( ) { }
@@ -36,3 +43,7 @@ fn main() {}
36
43
37
44
#[ cfg( all( sanitize = "thread" , thread) ) ]
38
45
fn main ( ) { }
46
+
47
+ pub fn check ( ) {
48
+ main ( ) ;
49
+ }
0 commit comments