• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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:
15function _ZN1A1BEv called 8589934592 returned 100% blocks executed 100%
168589934592:   10:void A::B() {}
178589934592:   10-block  0
18unconditional  0 taken 100%
19        -:   11:
20function _Z7uselessv called 0 returned 0% blocks executed 0%
21    #####:   12:void useless() {}
22    $$$$$:   12-block  0
23unconditional  0 never executed
24        -:   13:
25function _Z12more_uselessv called 0 returned 0% blocks executed 0%
26        -:   14:double more_useless() {
27    #####:   15:  return 0;
28    $$$$$:   15-block  0
29unconditional  0 never executed
30        -:   16:}
31        -:   17:
32function _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
37unconditional  0 taken 100%
38        -:   21:}
39        -:   22:
40function _Z3barv called 0 returned 0% blocks executed 0%
41        -:   23:int bar() {
42    #####:   24:  len--;
43    #####:   25:  return foo() + 45;
44    $$$$$:   25-block  0
45unconditional  0 never executed
46        -:   26:}
47        -:   27:
48function _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
53unconditional  0 taken 100%
54        -:   31:
55function _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
59unconditional  0 taken 100%
60        6:   33-block  1
61branch  1 taken 67%
62branch  2 taken 33%
63        4:   33-block  2
64unconditional  3 taken 100%
65       12:   34:    for (int jj = 0; jj < 2; jj++)
66        4:   34-block  0
67unconditional  0 taken 100%
68       12:   34-block  1
69branch  1 taken 67%
70branch  2 taken 33%
71        8:   34-block  2
72unconditional  3 taken 100%
73        8:   35:      assign(ii, jj);
74        8:   35-block  0
75unconditional  0 taken 100%
76        4:   35-block  1
77unconditional  1 taken 100%
78        2:   36:}
79        2:   36-block  0
80unconditional  0 taken 100%
81        -:   37:
82function 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
90branch  0 taken 100%
91branch  1 taken 0%
92        2:   44:    foo();
93        2:   45:    ++a;
94        2:   46:  } else {
95        2:   46-block  0
96unconditional  0 taken 100%
97    #####:   47:    bar();
98    #####:   48:    a += rand();
99    $$$$$:   48-block  0
100unconditional  0 never executed
101        -:   49:  }
102        -:   50:
103       22:   51:  for (int ii = 0; ii < 10; ++ii) {
104        2:   51-block  0
105unconditional  0 taken 100%
106       22:   51-block  1
107branch  1 taken 91%
108branch  2 taken 9%
109       20:   51-block  2
110unconditional  3 taken 100%
111       20:   52:    switch (rand() % 5) {
112       20:   52-block  0
113branch  0 taken 20%
114branch  1 taken 0%
115branch  2 taken 10%
116branch  3 taken 30%
117branch  4 taken 40%
118        -:   53:      case 0:
119        4:   54:        a += rand();
120        4:   55:        break;
121        4:   55-block  0
122unconditional  0 taken 100%
123        -:   56:      case 1:
124        -:   57:      case 2:
125        2:   58:        a += rand() / rand();
126        2:   59:        break;
127        2:   59-block  0
128unconditional  0 taken 100%
129        -:   60:      case 3:
130        6:   61:        a -= rand();
131        6:   62:        break;
132        6:   62-block  0
133unconditional  0 taken 100%
134        -:   63:      default:
135        8:   64:        a = -1;
136        8:   65:    }
137        8:   65-block  0
138unconditional  0 taken 100%
139       20:   66:  }
140       20:   66-block  0
141unconditional  0 taken 100%
142        -:   67:
143        2:   68:  A thing;
1448589934594:   69:  for (uint64_t ii = 0; ii < 4294967296; ++ii)
145        2:   69-block  0
146unconditional  0 taken 100%
1478589934594:   69-block  1
148branch  1 taken 99%
149branch  2 taken 1%
1508589934592:   69-block  2
151unconditional  3 taken 100%
1528589934592:   70:    thing.B();
1538589934592:   70-block  0
154unconditional  0 taken 100%
155        -:   71:
156        2:   72:  return a + 8 + grid[2][3] + len;
157        2:   72-block  0
158unconditional  0 taken 100%
159        -:   73:  return more_useless();
160        -:   74:}
161