What is the branch in the destructor reported by gcov?

前端 未结 3 1365
温柔的废话
温柔的废话 2020-12-01 01:30

When I use gcov to measure test coverage of C++ code it reports branches in destructors.

struct Foo
{
    virtual ~Foo()
    {
    }
};

int main (int argc,         


        
3条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 02:03

    In the destructor, GCC generated a conditial jump for a condition which can never be true (%al is not zero, since it was just assigned a 1):

    [...]
      29:   b8 01 00 00 00          mov    $0x1,%eax
      2e:   84 c0                   test   %al,%al
      30:   74 30                   je     62 <_ZN3FooD0Ev+0x62>
    [...]
    

提交回复
热议问题