Hi, I am using the GCOV command of GCC and have some puzzles on the branch information it provides.
For example, void main() { 2 int i,j; 2 j=0; 2 if(j<3) branch 0 taken = 0% 2 j++; 6 for(i=1;i<3;i++) branch 0 taken =67% branch 1 taken =100% branch 2 taken =100% 4 j++; 2 if(j<3) branch 0 taken=100% ###### j++; 2 }} call 0 returns=0% call 1 returns =100% Here for the statement "for(i=1;i<3;i++)", there are three branches: branch 0, branch 1, and branch 2. Branch 0 is the frequency that the branch statement is taken. What about the other branches? I don't know what's the meaning of them. When the if-statement contains more than one expression such as if (i>3 && j<2), then there would be 3 branches: branch 0, branch 1, and branch 2. What do these branches mean? Similarly, for the switch-statement, if there are 4 case-statements and 1 default-statement, there would be 6(not 5) branches. I am totally lost here. I sincerely hope that you can solve my puzzles, which is very important for me. Thanks a lot! Best Wishes, Dan