<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 - [LLVM-COV] Wrong coverage with shift operators in macro"
   href="https://bugs.llvm.org/show_bug.cgi?id=37071">37071</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[LLVM-COV] Wrong coverage with shift operators in macro
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Runtime Libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>libprofile library
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>yangyibiao@nju.edu.cn
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat small.c
#define ROR(a,b) (((a) >> (b)) | ((a) << ((sizeof (a) * 8) - (b))))

char c = 0xf234;

main ()
{
  if (ROR (c, 4) != ROR (c, 4))
    exit (1);

  exit (0);
}

$ clang -w -O0 -g -fcoverage-mapping -fprofile-instr-generate=small.profraw
small.c; ./a.out; llvm-profdata merge small.profraw -o small.profdata; llvm-cov
show a.out -instr-profile=small.profdata small.c > small.gcov; cat small.gcov
    1|      2|#define ROR(a,b) (((a) >> (b)) | ((a) << ((sizeof (a) * 8) -
(b))))
    2|       |
    3|       |char c = 0xf234;
    4|       |
    5|       |main ()
    6|      1|{
    7|      1|  if (ROR (c, 4) != ROR (c, 4))
    8|      1|    exit (1);
    9|      1|
   10|      1|  exit (0);
   11|      1|}


Line #8 is wrongly marked as executed.</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>