<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>Hello everyone,</div><div><br></div><div>During my llvm-cov usage I found some difference in llvm-cov out between llvm-cov generated text report and the JSON summary. I have presented it by the simple class.hpp file:</div><div><br></div><div>1) "llvm-cov show ..." output:</div><div>------------------------------<wbr>------------------------------<wbr>-----</div><div>Coverage Report</div><div>Created: 2017-04-26 09:52</div><div>/home/lumc/llvm_cov_test/<wbr>class.hpp:</div><div>    1|       |template<typename T></div><div>    2|       |class SampleTemplate</div><div>    3|       |{</div><div>    4|       |public:</div><div>    5|       |   inline T SampleMethod(const T& a, const T& b)</div><div>    6|      1|   {</div><div>    7|      1|      #if DEFINE</div><div>    8|       |      T ret = b;</div><div>    9|       |      #else</div><div>   10|      1|      T ret = a;</div><div>   11|      1|      #endif</div><div>   12|      1|      return ret;</div><div>   13|      1|   }</div><div>   14|       |};</div><div>------------------------------<wbr>------------------------------<wbr>-----</div><div>here in the repert for class.hpp file I have 6 lines covered.</div><div><br></div><div>2) part of json generated by "llvm-cov export ...":</div><div>------------------------------<wbr>------------------------------<wbr>-----</div><div>...</div><div>                    "expansions": [],</div><div>                    "filename": "/home/lumc/llvm_cov_test/<wbr>class.hpp",</div><div>                    "segments": [</div><div>                        [</div><div>                            6,</div><div>                            4,</div><div>                            1,</div><div>                            1,</div><div>                            1</div><div>                        ],</div><div>                        [</div><div>                            7,</div><div>                            8,</div><div>                            0,</div><div>                            0,</div><div>                            1</div><div>                        ],</div><div>                        [</div><div>                            9,</div><div>                            8,</div><div>                            1,</div><div>                            1,</div><div>                            0</div><div>                        ],</div><div>                        [</div><div>                            13,</div><div>                            5,</div><div>                            0,</div><div>                            0,</div><div>                            0</div><div>                        ]</div><div>                    ],</div><div>                    "summary": {</div><div>                        "functions": {</div><div>                            "count": 1,</div><div>                            "covered": 1,</div><div>                            "percent": 100</div><div>                        },</div><div>                        "instantiations": {</div><div>                            "count": 1,</div><div>                            "covered": 1,</div><div>                            "percent": 100</div><div>                        },</div><div>                        "lines": {</div><div>                            "count": 5,</div><div>                            "covered": 5,</div><div>                            "percent": 100</div><div>                        },</div><div>                        "regions": {</div><div>                            "count": 1,</div><div>                            "covered": 1,</div><div>                            "notcovered": 0,</div><div>                            "percent": 100</div><div>                        }</div><div>                    }</div><div>...</div><div>------------------------------<wbr>-----------------------</div><div>but in "summary" object for the class.hpp file I have 5 lines only.</div><div><br></div><div>Can you explain me from where this difference comes?</div><div><br></div><div>I have shared all used and generated files at: <a href="https://drive.google.com/open?id=0Bw3a4ra_CUr3S09OV0JOaDVmX00" target="_blank">https://drive.google.com/open?<wbr>id=0Bw3a4ra_<wbr>CUr3S09OV0JOaDVmX00</a></div><div><br></div><div>kind regards,</div><div>Łukasz Machowski</div></div></div></div>