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: unassignedb...@nondot.org
          Reporter: yangyib...@nju.edu.cn
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to