Skip to content

BRDA Branch coverage #334

Closed as not planned
Closed as not planned
@Jeling-W

Description

@Jeling-W

In the .info file, there is information:
BRDA:<line_number>,<block>,<branch>,<taken>
How should I understand the block number? I have a .info file with some information:

BRDA:139,0,0,36
BRDA:139,0,1,81
BRDA:139,0,2,0
BRDA:139,0,3,4
BRDA:139,0,4,4
BRDA:139,0,5,628

The corresponding source code is:

switch (cmdType) {
    case 1:
        xxxx
    case 2:
        xxxx
        break;
    case 3:
        xxxx
        break;
    case 4:
        xxxx
        break;
    case 5:
        xxxx
        break;
    default: {
        xxxx
        break;
    }
}

I understand that a basic block is a sequence of continuous instructions that are not interrupted by branches or jump instructions during program execution. So why does the code here all belong to the same block number 0? How should I understand the basic blocks here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions