<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 - Coverage report is wrong : the count after executing exit(1) is wrong"
   href="https://bugs.llvm.org/show_bug.cgi?id=39795">39795</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Coverage report is wrong : the count after executing exit(1) is wrong
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </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>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ueno.masakazu@jp.fujitsu.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>For the cooverage report, the count after executing exit(1) is wrong.


$ clang --version             
clang version 8.0.0 (trunk 347601)            
Target: x86_64-unknown-linux-gnu              
Thread model: posix                           
InstalledDir: /opt/llvm/svn-trunk/install/bin 


$ clang --coverage cov_ng.c 
$ ./a.out
sub start
sub end
sub start
sub end
sub start
sub end
sub start
$ llvm-cov gcov cov_ng.c
File 'cov_ng.c'
Lines executed:100.00% of 13
cov_ng.c:creating 'cov_ng.c.gcov'
$ cat cov_ng.c.gcov
        -:    0:Source:cov_ng.c
        -:    0:Graph:cov_ng.gcno
        -:    0:Data:cov_ng.gcda
        -:    0:Runs:1
        -:    0:Programs:1
        -:    1:
        -:    2:
        -:    3:#include <stdio.h>
        -:    4:#include <stdlib.h>
        -:    5:
        4:    6:void sub (int x) {
        -:    7:
        4:    8:  printf("sub start\n");
        -:    9:
        4:   10:  if (x == 0) {
        1:   11:    exit (1);
        -:   12:    printf("NG");
        -:   13:  }
        -:   14:
        3:   15:  printf("sub end\n");
        3:   16:  return ;
        -:   17:}
        -:   18:
        1:   19:int main () {
        1:   20:  sub (10);
        1:   21:  sub (10);
        1:   22:  sub (10);
        1:   23:  sub (0);
        1:   24:  sub (10);
        1:   25:}
        -:   26:

  For the counts on lines 24 and 25, "-:" is correct, not "1:".</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>