[llvm-bugs] [Bug 33465] New: llvm-cov: the '||' operator in an assign statement lead to the statement marked as unexecuted

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 14 18:33:16 PDT 2017


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: unassignedclangbugs at nondot.org
          Reporter: yangyibiao at nju.edu.cn
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170615/09c300c5/attachment.html>


More information about the llvm-bugs mailing list