kInterceptorName, kInterceptorViaFunction, kInterceptorViaLibrary,
kODRViolation};
+extern "C" {
+#if SANITIZER_SUPPORTS_WEAK_HOOKS
+SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
+const char *__asan_default_suppressions();
+#else
+// No week hooks, provide empty implementation.
+const char *__asan_default_suppressions() { return ""; }
+#endif // SANITIZER_SUPPORTS_WEAK_HOOKS
+} // extern "C"
+
void InitializeSuppressions() {
CHECK_EQ(nullptr, suppression_ctx);
suppression_ctx = new (suppression_placeholder) // NOLINT
SuppressionContext(kSuppressionTypes, ARRAY_SIZE(kSuppressionTypes));
suppression_ctx->ParseFromFile(flags()->suppressions);
+ if (&__asan_default_suppressions)
+ suppression_ctx->Parse(__asan_default_suppressions());
}
bool IsInterceptorSuppressed(const char *interceptor_name) {
--- /dev/null
+// Test that we use the suppressions from __asan_default_suppressions.
+// RUN: %clangxx_asan %s -o %t && not %run %t 2>&1 | FileCheck %s
+extern "C" {
+ const char *__asan_default_suppressions() { return "FooBar"; }
+}
+// CHECK: AddressSanitizer: failed to parse suppressions
+int main() {}