/root/bitcoin/src/test/util/coverage.cpp
Line | Count | Source |
1 | | // Copyright (c) 2025-present The Bitcoin Core developers |
2 | | // Distributed under the MIT software license, see the accompanying |
3 | | // file COPYING or http://www.opensource.org/licenses/mit-license.php. |
4 | | |
5 | | #include <test/util/coverage.h> |
6 | | |
7 | | #if defined(__clang__) |
8 | | extern "C" __attribute__((weak)) void __llvm_profile_reset_counters(void); |
9 | | extern "C" __attribute__((weak)) void __gcov_reset(void); |
10 | | |
11 | | // Fallback implementations |
12 | 0 | extern "C" __attribute__((weak)) void __llvm_profile_reset_counters(void) {} |
13 | 1 | extern "C" __attribute__((weak)) void __gcov_reset(void) {} |
14 | | |
15 | 0 | void ResetCoverageCounters() { |
16 | | // These will call the real ones if available, or our dummies if not |
17 | 0 | __llvm_profile_reset_counters(); |
18 | 0 | __gcov_reset(); |
19 | 0 | } |
20 | | #else |
21 | | void ResetCoverageCounters() {} |
22 | | #endif |