Summary: This permits combining -fsanitize-coverage with -fsanitize=bounds or -fsanitize=thread. Note that, GCC already supports combining these. Tested: - Add Clang end-to-end test checking IR is generated for both combinations of sanitizers. - Several previously failing TSAN tests now pass. Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=45831 Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: #sanitizers, dvyukov, nickdesaulniers, cfe-commits Tags: #clang, #sanitizers Differential Revision: https://reviews.llvm.org/D79628
17 lines
770 B
C++
17 lines
770 B
C++
// Tests -fsanitize-coverage=no-prune
|
|
|
|
// REQUIRES: has_sancovcc,stable-runtime
|
|
// UNSUPPORTED: i386-darwin
|
|
// XFAIL: ubsan
|
|
// XFAIL: android && asan
|
|
|
|
// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc,bb,no-prune 2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 3
|
|
// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc,bb 2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 2
|
|
// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc,no-prune 2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 4
|
|
// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc 2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 3
|
|
|
|
void foo(int *a) {
|
|
if (a)
|
|
*a = 1;
|
|
}
|