<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Wrong line hit counts when building without "-fno-exceptions""
href="https://bugs.llvm.org/show_bug.cgi?id=38066">38066</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrong line hit counts when building without "-fno-exceptions"
</td>
</tr>
<tr>
<th>Product</th>
<td>compiler-rt
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>profile
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mcastelluccio@mozilla.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=20523" name="attach_20523" title="Archive with GCNO, GCDA, source file and GCOV output">attachment 20523</a> <a href="attachment.cgi?id=20523&action=edit" title="Archive with GCNO, GCDA, source file and GCOV output">[details]</a></span>
Archive with GCNO, GCDA, source file and GCOV output
clang++ --coverage -O0 main.cpp
./a.out
llvm-cov gcov main.gcda
The result is:
-: 0:Source:main.cpp
-: 0:Graph:main.gcno
-: 0:Data:main.gcda
-: 0:Runs:1
-: 0:Programs:1
-: 1:#include <iostream>
-: 2:#include <string>
-: 3:
-: 4:using namespace std;
-: 5:
2: 6:class Ciao {
-: 7: public:
-: 8: void setName(string n) {
1: 9: name = n;
1: 10: }
-: 11:
-: 12: private:
-: 13: string name;
-: 14:};
-: 15:
-: 16:int main(void)
-: 17:{
1: 18: Ciao ciao;
-: 19:
3: 20: ciao.setName("marco");
-: 21:
1: 22: return 0;
1: 23:}
Or with llvm-cov gcov -a -b -c main.gcda:
-: 0:Source:main.cpp
-: 0:Graph:main.gcno
-: 0:Data:main.gcda
-: 0:Runs:1
-: 0:Programs:1
-: 1:#include <iostream>
-: 2:#include <string>
-: 3:
-: 4:using namespace std;
-: 5:
function _ZN4CiaoC2Ev called 1 returned 100% blocks executed 100%
function _ZN4CiaoD2Ev called 1 returned 100% blocks executed 100%
1: 6:class Ciao {
1: 6-block 0
1: 6-block 1
-: 7: public:
function _ZN4Ciao7setNameENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
called 1 returned 100% blocks executed 100%
-: 8: void setName(string n) {
1: 9: name = n;
1: 10: }
1: 10-block 0
-: 11:
-: 12: private:
-: 13: string name;
-: 14:};
-: 15:
function main called 1 returned 100% blocks executed 50%
-: 16:int main(void)
-: 17:{
1: 18: Ciao ciao;
-: 19:
1: 20: ciao.setName("marco");
1: 20-block 0
branch 0 taken 1
branch 1 taken 0
1: 20-block 1
branch 2 taken 1
branch 3 taken 0
$$$$$: 20-block 2
-: 21:
1: 22: return 0;
1: 23:}
1: 23-block 0
$$$$$: 23-block 1
$$$$$: 23-block 2
$$$$$: 23-block 3</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>