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