|
4 | 4 | // needs-sanitizer-support
|
5 | 5 | // only-linux
|
6 | 6 | // only-x86_64
|
7 |
| -// revisions:ASAN ASAN-RECOVER MSAN MSAN-RECOVER |
| 7 | +// revisions:ASAN ASAN-RECOVER MSAN MSAN-RECOVER MSAN-RECOVER-LTO |
| 8 | +// no-prefer-dynamic |
8 | 9 | //
|
9 |
| -//[ASAN] compile-flags: -Zsanitizer=address |
10 |
| -//[ASAN-RECOVER] compile-flags: -Zsanitizer=address -Zsanitizer-recover=address |
11 |
| -//[MSAN] compile-flags: -Zsanitizer=memory |
12 |
| -//[MSAN-RECOVER] compile-flags: -Zsanitizer=memory -Zsanitizer-recover=memory |
13 |
| - |
14 |
| -#![crate_type="lib"] |
| 10 | +//[ASAN] compile-flags: -Zsanitizer=address |
| 11 | +//[ASAN-RECOVER] compile-flags: -Zsanitizer=address -Zsanitizer-recover=address |
| 12 | +//[MSAN] compile-flags: -Zsanitizer=memory |
| 13 | +//[MSAN-RECOVER] compile-flags: -Zsanitizer=memory -Zsanitizer-recover=memory |
| 14 | +//[MSAN-RECOVER-LTO] compile-flags: -Zsanitizer=memory -Zsanitizer-recover=memory -C lto=fat |
| 15 | +// |
| 16 | +// MSAN-NOT: @__msan_keep_going |
| 17 | +// MSAN-RECOVER: @__msan_keep_going = weak_odr {{.*}} constant i32 1 |
| 18 | +// MSAN-RECOVER-LTO: @__msan_keep_going = weak_odr {{.*}} constant i32 1 |
15 | 19 |
|
16 |
| -// ASAN-LABEL: define i32 @penguin( |
| 20 | +// ASAN-LABEL: define i32 @penguin( |
| 21 | +// ASAN: call void @__asan_report_load4(i64 %0) |
| 22 | +// ASAN: unreachable |
| 23 | +// ASAN: } |
| 24 | +// |
17 | 25 | // ASAN-RECOVER-LABEL: define i32 @penguin(
|
18 |
| -// MSAN-LABEL: define i32 @penguin( |
| 26 | +// ASAN-RECOVER: call void @__asan_report_load4_noabort( |
| 27 | +// ASAN-RECOVER-NOT: unreachable |
| 28 | +// ASAN: } |
| 29 | +// |
| 30 | +// MSAN-LABEL: define i32 @penguin( |
| 31 | +// MSAN: call void @__msan_warning_noreturn() |
| 32 | +// MSAN: unreachable |
| 33 | +// MSAN: } |
| 34 | +// |
19 | 35 | // MSAN-RECOVER-LABEL: define i32 @penguin(
|
| 36 | +// MSAN-RECOVER: call void @__msan_warning() |
| 37 | +// MSAN-RECOVER-NOT: unreachable |
| 38 | +// MSAN-RECOVER: } |
| 39 | +// |
| 40 | +// MSAN-RECOVER-LTO-LABEL: define i32 @penguin( |
| 41 | +// MSAN-RECOVER-LTO: call void @__msan_warning() |
| 42 | +// MSAN-RECOVER-LTO-NOT: unreachable |
| 43 | +// MSAN-RECOVER-LTO: } |
| 44 | +// |
20 | 45 | #[no_mangle]
|
21 | 46 | pub fn penguin(p: &mut i32) -> i32 {
|
22 |
| - // ASAN: call void @__asan_report_load4(i64 %0) |
23 |
| - // ASAN: unreachable |
24 |
| - // |
25 |
| - // ASAN-RECOVER: call void @__asan_report_load4_noabort( |
26 |
| - // ASAN-RECOVER-NOT: unreachable |
27 |
| - // |
28 |
| - // MSAN: call void @__msan_warning_noreturn() |
29 |
| - // MSAN: unreachable |
30 |
| - // |
31 |
| - // MSAN-RECOVER: call void @__msan_warning() |
32 |
| - // MSAN-RECOVER-NOT: unreachable |
33 | 47 | *p
|
34 | 48 | }
|
| 49 | + |
| 50 | +fn main() {} |
0 commit comments