blob: a3dacc269ead8f67760276eb92898938356b073c [file] [log] [blame]
Yuchen Wuaae88012013-11-13 22:50:15 +00001 -: 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 <cstdlib>
7 -: 2:
8 -: 3:bool on = false;
9 -: 4:int len = 42;
10 -: 5:double grid[10][10] = {0};
11 -: 6:const char * hello = "world";
12 -: 7:const char * world = "hello";
13 -: 8:
14 4: 9:struct A {
15 -: 10: virtual void B();
16 -: 11:};
17 -: 12:
188589934592: 13:void A::B() {}
19 -: 14:
20 #####: 15:void useless() {}
21 -: 16:
22 -: 17:double more_useless() {
23 #####: 18: return 0;
24 -: 19:}
25 -: 20:
26 -: 21:int foo() {
27 2: 22: on = true;
28 2: 23: return 3;
29 -: 24:}
30 -: 25:
31 -: 26:int bar() {
32 #####: 27: len--;
33 #####: 28: return foo() + 45;
34 -: 29:}
35 -: 30:
36 8: 31:void assign(int ii, int jj) {
37 8: 32: grid[ii][jj] = (ii+1) * (jj+1);
38 8: 33:}
39 -: 34:
40 -: 35:void initialize_grid() {
41 12: 36: for (int ii = 0; ii < 2; ii++)
42 24: 37: for (int jj = 0; jj < 2; jj++)
43 12: 38: assign(ii, jj);
44 2: 39:}
45 -: 40:
46 -: 41:int main() {
47 2: 42: initialize_grid();
48 -: 43:
49 2: 44: int a = 2;
50 2: 45: on = rand() % 2;
51 2: 46: if (on) {
52 2: 47: foo();
53 2: 48: ++a;
54 2: 49: } else {
55 #####: 50: bar();
56 #####: 51: a += rand();
57 -: 52: }
58 -: 53:
59 44: 54: for (int ii = 0; ii < 10; ++ii) {
60 20: 55: switch (rand() % 5) {
61 -: 56: case 0:
62 4: 57: a += rand();
63 4: 58: break;
64 -: 59: case 1:
65 -: 60: case 2:
66 2: 61: a += rand() / rand();
67 2: 62: break;
68 -: 63: case 3:
69 6: 64: a -= rand();
70 6: 65: break;
71 -: 66: default:
72 8: 67: a = -1;
73 8: 68: }
74 20: 69: }
75 -: 70:
76 2: 71: A thing;
7717179869188: 72: for (uint64_t ii = 0; ii < 4294967296; ++ii)
788589934592: 73: thing.B();
79 -: 74:
80 2: 75: return a + 8 + grid[2][3] + len;
81 -: 76: return more_useless();
82 -: 77:}