mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-02 18:58:15 +00:00
4fbc66cd6d
Like other sanitizers, enable __has_feature(coverage_sanitizer) if clang has enabled at least one SanitizerCoverage instrumentation type. Because coverage instrumentation selection is not handled via normal -fsanitize= (and thus not in SanitizeSet), passing this information through to LangOptions required propagating the already parsed -fsanitize-coverage= options from CodeGenOptions through to LangOptions in FixupInvocation(). Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D103159
16 lines
750 B
C++
16 lines
750 B
C++
// RUN: %clang -E -fsanitize-coverage=indirect-calls %s -o - | FileCheck --check-prefix=CHECK-SANCOV %s
|
|
// RUN: %clang -E -fsanitize-coverage=inline-8bit-counters %s -o - | FileCheck --check-prefix=CHECK-SANCOV %s
|
|
// RUN: %clang -E -fsanitize-coverage=trace-cmp %s -o - | FileCheck --check-prefix=CHECK-SANCOV %s
|
|
// RUN: %clang -E -fsanitize-coverage=trace-pc %s -o - | FileCheck --check-prefix=CHECK-SANCOV %s
|
|
// RUN: %clang -E -fsanitize-coverage=trace-pc-guard %s -o - | FileCheck --check-prefix=CHECK-SANCOV %s
|
|
// RUN: %clang -E %s -o - | FileCheck --check-prefix=CHECK-NO-SANCOV %s
|
|
|
|
#if __has_feature(coverage_sanitizer)
|
|
int SancovEnabled();
|
|
#else
|
|
int SancovDisabled();
|
|
#endif
|
|
|
|
// CHECK-SANCOV: SancovEnabled
|
|
// CHECK-NO-SANCOV: SancovDisabled
|