llvm.org GIT mirror llvm / 95f83b3
[sanitizer-coverage] don't instrument available_externally functions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309611 91177308-0d34-0410-b5e6-96231b3b80d8 Kostya Serebryany 2 years ago
2 changed file(s) with 13 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
417417 return false; // Should not instrument sanitizer init functions.
418418 if (F.getName().startswith("__sanitizer_"))
419419 return false; // Don't instrument __sanitizer_* callbacks.
420 // Don't touch available_externally functions, their actual body is elewhere.
421 if (F.getLinkage() == GlobalValue::AvailableExternallyLinkage)
422 return false;
420423 // Don't instrument MSVC CRT configuration helpers. They may run before normal
421424 // initialization.
422425 if (F.getName() == "__local_stdio_printf_options" ||
1717 ret void
1818 }
1919
20 define available_externally void @external_bar(i32* %a) sanitize_address {
21 entry:
22 ret void
23 }
24
25
2026 ; CHECK_PC-LABEL: define void @foo
2127 ; CHECK_PC: call void @__sanitizer_cov_trace_pc
2228 ; CHECK_PC: call void @__sanitizer_cov_trace_pc
3238 ; CHECK_PC_GUARD: call void @__sanitizer_cov_trace_pc_guard
3339 ; CHECK_PC_GUARD-NOT: call void @__sanitizer_cov_trace_pc
3440 ; CHECK_PC_GUARD: ret void
41 ; CHECK_PC_GUARD-LABEL: @external_bar
42 ; CHECK_PC_GUARD-NOT: call void @__sanitizer_cov_trace_pc
43 ; CHECK_PC_GUARD: ret void
44
3545 ; CHECK_PC_GUARD: call void @__sanitizer_cov_trace_pc_guard_init(i32* bitcast (i32** @__start___sancov_guards to i32*), i32* bitcast (i32** @__stop___sancov_guards to i32*))
3646
3747 ; CHECK_PC_GUARD_DARWIN-LABEL: define void @foo