1 // Verifies that AddressSanitizer and MemorySanitizer
2 // recovery mode can be enabled with -Zsanitizer-recover.
4 // needs-sanitizer-address
5 // needs-sanitizer-memory
6 // revisions:ASAN ASAN-RECOVER MSAN MSAN-RECOVER MSAN-RECOVER-LTO
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 //[MSAN-RECOVER-LTO] compile-flags: -Zsanitizer=memory -Zsanitizer-recover=memory -C lto=fat
15 // MSAN-NOT: @__msan_keep_going
16 // MSAN-RECOVER: @__msan_keep_going = weak_odr {{.*}}constant i32 1
17 // MSAN-RECOVER-LTO: @__msan_keep_going = weak_odr {{.*}}constant i32 1
19 // ASAN-LABEL: define dso_local i32 @penguin(
20 // ASAN: call void @__asan_report_load4(i64 %0)
24 // ASAN-RECOVER-LABEL: define dso_local i32 @penguin(
25 // ASAN-RECOVER: call void @__asan_report_load4_noabort(
26 // ASAN-RECOVER-NOT: unreachable
29 // MSAN-LABEL: define dso_local i32 @penguin(
30 // MSAN: call void @__msan_warning{{(_with_origin_noreturn\(i32 0\)|_noreturn\(\))}}
34 // MSAN-RECOVER-LABEL: define dso_local i32 @penguin(
35 // MSAN-RECOVER: call void @__msan_warning{{(_with_origin\(i32 0\)|\(\))}}
36 // MSAN-RECOVER-NOT: unreachable
39 // MSAN-RECOVER-LTO-LABEL: define dso_local i32 @penguin(
40 // MSAN-RECOVER-LTO: call void @__msan_warning{{(_with_origin\(i32 0\)|\(\))}}
41 // MSAN-RECOVER-LTO-NOT: unreachable
42 // MSAN-RECOVER-LTO: }
45 pub fn penguin(p: &mut i32) -> i32 {