reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
        -:    0:Source:test.cpp
        -:    0:Graph:test.gcno
        -:    0:Data:test.gcda
        -:    0:Runs:2
        -:    0:Programs:1
        -:    1:#include "test.h"
        -:    2:#include <cstdlib>
        -:    3:
        -:    4:bool on = false;
        -:    5:int len = 42;
        -:    6:double grid[10][10] = {0};
        -:    7:const char * hello = "world";
        -:    8:const char * world = "hello";
        -:    9:
function _ZN1A1BEv called 8589934592 returned 100% blocks executed 100%
8589934592:   10:void A::B() {}
8589934592:   10-block  0
unconditional  0 taken 100%
        -:   11:
function _Z7uselessv called 0 returned 0% blocks executed 0%
    #####:   12:void useless() {}
    $$$$$:   12-block  0
unconditional  0 never executed
        -:   13:
function _Z12more_uselessv called 0 returned 0% blocks executed 0%
        -:   14:double more_useless() {
    #####:   15:  return 0;
    $$$$$:   15-block  0
unconditional  0 never executed
        -:   16:}
        -:   17:
function _Z3foov called 2 returned 100% blocks executed 100%
        -:   18:int foo() {
        2:   19:  on = true;
        2:   20:  return 3;
        2:   20-block  0
unconditional  0 taken 100%
        -:   21:}
        -:   22:
function _Z3barv called 0 returned 0% blocks executed 0%
        -:   23:int bar() {
    #####:   24:  len--;
    #####:   25:  return foo() + 45;
    $$$$$:   25-block  0
unconditional  0 never executed
        -:   26:}
        -:   27:
function _Z6assignii called 8 returned 100% blocks executed 100%
        8:   28:void assign(int ii, int jj) {
        8:   29:  grid[ii][jj] = (ii+1) * (jj+1);
        8:   30:}
        8:   30-block  0
unconditional  0 taken 100%
        -:   31:
function _Z15initialize_gridv called 2 returned 100% blocks executed 100%
        -:   32:void initialize_grid() {
        6:   33:  for (int ii = 0; ii < 2; ii++)
        2:   33-block  0
unconditional  0 taken 100%
        6:   33-block  1
branch  1 taken 67%
branch  2 taken 33%
        4:   33-block  2
unconditional  3 taken 100%
       12:   34:    for (int jj = 0; jj < 2; jj++)
        4:   34-block  0
unconditional  0 taken 100%
       12:   34-block  1
branch  1 taken 67%
branch  2 taken 33%
        8:   34-block  2
unconditional  3 taken 100%
       12:   35:      assign(ii, jj);
        8:   35-block  0
unconditional  0 taken 100%
        4:   35-block  1
unconditional  1 taken 100%
        2:   36:}
        2:   36-block  0
unconditional  0 taken 100%
        -:   37:
function main called 2 returned 100% blocks executed 94%
        -:   38:int main() {
        2:   39:  initialize_grid();
        -:   40:
        2:   41:  int a = 2;
        2:   42:  on = rand() % 2;
        2:   43:  if (on) {
        2:   43-block  0
branch  0 taken 100%
branch  1 taken 0%
        2:   44:    foo();
        2:   45:    ++a;
        2:   46:  } else {
        2:   46-block  0
unconditional  0 taken 100%
    #####:   47:    bar();
    #####:   48:    a += rand();
    $$$$$:   48-block  0
unconditional  0 never executed
        -:   49:  }
        -:   50:
       22:   51:  for (int ii = 0; ii < 10; ++ii) {
        2:   51-block  0
unconditional  0 taken 100%
       22:   51-block  1
branch  1 taken 91%
branch  2 taken 9%
       20:   51-block  2
unconditional  3 taken 100%
       20:   52:    switch (rand() % 5) {
       20:   52-block  0
branch  0 taken 20%
branch  1 taken 0%
branch  2 taken 10%
branch  3 taken 30%
branch  4 taken 40%
        -:   53:      case 0:
        4:   54:        a += rand();
        4:   55:        break;
        4:   55-block  0
unconditional  0 taken 100%
        -:   56:      case 1:
        -:   57:      case 2:
        2:   58:        a += rand() / rand();
        2:   59:        break;
        2:   59-block  0
unconditional  0 taken 100%
        -:   60:      case 3:
        6:   61:        a -= rand();
        6:   62:        break;
        6:   62-block  0
unconditional  0 taken 100%
        -:   63:      default:
        8:   64:        a = -1;
        8:   65:    }
        8:   65-block  0
unconditional  0 taken 100%
       20:   66:  }
       20:   66-block  0
unconditional  0 taken 100%
        -:   67:
        2:   68:  A thing;
8589934594:   69:  for (uint64_t ii = 0; ii < 4294967296; ++ii)
        2:   69-block  0
unconditional  0 taken 100%
8589934594:   69-block  1
branch  1 taken 99%
branch  2 taken 1%
8589934592:   69-block  2
unconditional  3 taken 100%
8589934592:   70:    thing.B();
8589934592:   70-block  0
unconditional  0 taken 100%
        -:   71:
        2:   72:  return a + 8 + grid[2][3] + len;
        2:   72-block  0
unconditional  0 taken 100%
        -:   73:  return more_useless();
        -:   74:}