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

            Bug ID: 33465
           Summary: llvm-cov: the '||' operator in an assign statement
                    lead to the statement marked as unexecuted
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: yangyib...@nju.edu.cn
                CC: llvm-bugs@lists.llvm.org

Left part of the '||' operator in an assign statement is executed but the right
part is not executed.
This will lead the assign statement being marked as unexecuted in the llvm-cov.

$ clang-5.0 -O0 -fcoverage-mapping -fprofile-instr-generate=small.profraw
small.c -o small
$ llvm-profdata-5.0 merge -o small.profdata small.profraw
$ llvm-cov-5.0 show small -instr-profile=small.profdata small.c > small.gcov

/* small.c */
$ cat small.c
void main()
{
    int g, v = 1;
    g = v || !v;
    return;
}


/* small.gcov */
$ cat small.gcov
    1|       |void main()
    2|      1|{
    3|      1|    int g, v = 1;
    4|      0|    g = v || !v;
    5|      1|    return;
    6|      1|}

-- 
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