[llvm-bugs] [Bug 37046] New: [LLVM-COV] two continues return statements are both marked as executed when they are after a statement with many binary operators in llvm-cov

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Apr 7 07:36:09 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37046

            Bug ID: 37046
           Summary: [LLVM-COV] two continues return statements are both
                    marked as executed when they are after a statement
                    with many binary operators in llvm-cov
           Product: Runtime Libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: libprofile library
          Assignee: unassignedbugs at nondot.org
          Reporter: yangyibiao at nju.edu.cn
                CC: llvm-bugs at lists.llvm.org

$ cat small.c
int a, b, c, d, e;
int main() {
  ((e=a) && c || 5 || 0) == b || d;
  return 0;
  return 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|       |int a, b, c, d, e;
    2|      1|int main() {
    3|      1|  ((e=a) && c || 5 || 0) == b || d;
    4|      1|  return 0;
    5|      1|  return 0;
    6|      1|}


************
Line #5 is wrongly marked as executed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180407/6daf17d1/attachment.html>


More information about the llvm-bugs mailing list