Fix some coverage lost when multithreaded, #2151.

This commit is contained in:
Wilson Snyder
2020-02-03 18:43:41 -05:00
parent 2ca9f73b31
commit f3ebdc40c6
3 changed files with 35 additions and 14 deletions
+4 -1
View File
@@ -437,7 +437,10 @@ void EmitCSyms::emitSymHdr() {
if (m_coverBins) {
puts("\n// COVERAGE\n");
puts("uint32_t __Vcoverage["); puts(cvtToStr(m_coverBins)); puts("];\n");
puts(v3Global.opt.threads() ? "std::atomic<uint32_t>" : "uint32_t");
puts(" __Vcoverage[");
puts(cvtToStr(m_coverBins));
puts("];\n");
}
if (!m_scopeNames.empty()) { // Scope names