• 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:
158589934592:   10:void A::B() {}
168589934592:   10-block  0
17        -:   11:
18    #####:   12:void useless() {}
19    $$$$$:   12-block  0
20        -:   13:
21        -:   14:double more_useless() {
22    #####:   15:  return 0;
23    $$$$$:   15-block  0
24        -:   16:}
25        -:   17:
26        -:   18:int foo() {
27        2:   19:  on = true;
28        2:   20:  return 3;
29        2:   20-block  0
30        -:   21:}
31        -:   22:
32        -:   23:int bar() {
33    #####:   24:  len--;
34    #####:   25:  return foo() + 45;
35    $$$$$:   25-block  0
36        -:   26:}
37        -:   27:
38        8:   28:void assign(int ii, int jj) {
39        8:   29:  grid[ii][jj] = (ii+1) * (jj+1);
40        8:   30:}
41        8:   30-block  0
42        -:   31:
43        -:   32:void initialize_grid() {
44        6:   33:  for (int ii = 0; ii < 2; ii++)
45        2:   33-block  0
46        6:   33-block  1
47        4:   33-block  2
48       12:   34:    for (int jj = 0; jj < 2; jj++)
49        4:   34-block  0
50       12:   34-block  1
51        8:   34-block  2
52        8:   35:      assign(ii, jj);
53        8:   35-block  0
54        4:   35-block  1
55        2:   36:}
56        2:   36-block  0
57        -:   37:
58        -:   38:int main() {
59        2:   39:  initialize_grid();
60        -:   40:
61        2:   41:  int a = 2;
62        2:   42:  on = rand() % 2;
63        2:   43:  if (on) {
64        2:   43-block  0
65        2:   44:    foo();
66        2:   45:    ++a;
67        2:   46:  } else {
68        2:   46-block  0
69    #####:   47:    bar();
70    #####:   48:    a += rand();
71    $$$$$:   48-block  0
72        -:   49:  }
73        -:   50:
74       22:   51:  for (int ii = 0; ii < 10; ++ii) {
75        2:   51-block  0
76       22:   51-block  1
77       20:   51-block  2
78       20:   52:    switch (rand() % 5) {
79       20:   52-block  0
80        -:   53:      case 0:
81        4:   54:        a += rand();
82        4:   55:        break;
83        4:   55-block  0
84        -:   56:      case 1:
85        -:   57:      case 2:
86        2:   58:        a += rand() / rand();
87        2:   59:        break;
88        2:   59-block  0
89        -:   60:      case 3:
90        6:   61:        a -= rand();
91        6:   62:        break;
92        6:   62-block  0
93        -:   63:      default:
94        8:   64:        a = -1;
95        8:   65:    }
96        8:   65-block  0
97       20:   66:  }
98       20:   66-block  0
99        -:   67:
100        2:   68:  A thing;
1018589934594:   69:  for (uint64_t ii = 0; ii < 4294967296; ++ii)
102        2:   69-block  0
1038589934594:   69-block  1
1048589934592:   69-block  2
1058589934592:   70:    thing.B();
1068589934592:   70-block  0
107        -:   71:
108        2:   72:  return a + 8 + grid[2][3] + len;
109        2:   72-block  0
110        -:   73:  return more_useless();
111        -:   74:}
112